Afternoon,
I have a workbook with two macros that don't get along. If the reference needed for the first is active, then the second crashes. So, I'm trying to manually set the reference within the first macro, then deactivate it at the end using a GUID.
Dim refMSO12 As References
Set refMSO12 = New References
'Adds in the Microsoft Office 12.0 Object Library
strGUID = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}"
ThisWorkbook.VBProject.References.AddFromGuid(strGUID, 2, 4) = refMSO12
.... Macro Content ....
With References
.Remove refMSO12
End With
It crashes on the Set refMSO12 = New References with a Run-Time Error 429: ActiveX component cannot create object. If I take that line out, it does actually add in the library, but also gives another errror of 438: Object doesn't support this property or method (doesn't highlight whats wrong either).
Thanks much for your help!
Carl
Bookmarks