Lost VBA References

Puertorekinsam

Active Member
Joined
Oct 8, 2005
Messages
293
I have a excel add in built in excel 2013.
Half of my team has 2013, half of my team has 2010...

One of the References I use in the code is: "Microsoft Office 15.0 Object Library" The team members that have office 2013, have no problems. The teammates that have Office 2010, it throws a compile error.
I have found the missing DLL file and given it to the team members who are experiencing the issue. If they point to that file it will work... until they close excel. Once they close and reopen, the reference is lost. I have tried the following:
1) I have had them save the add in after updating the reference,
2) we've added a dummy line of code (x=x) and saved the add in to make sure the save is working
3) I have updated the reference on my machine to point to a copy of the dll on a shared directory and sent that updated add in to them.

No matter what, the reference does not seem to save.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
The problem is Office 2013 can resolve the reference to Office 2010, but not otherwise.
You could add the reference programmatically. Change path according to x64 or x86 Office and also you have to tap the following check box: File->Options->Trust Center->Trust Center Settings->Macro Settings->Trust access to the VBA project object model.
Code:
Sub AddOfficeRef()
        ThisWorkbook.VBProject.References.AddFromFile Environ$("SystemDrive") & "\Program Files\Common Files\microsoft shared\OFFICE14\MSO.DLL"
End Sub
You can read this.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top