I have been using VBA code to load references for projects. An example is below.
This has worked fine until I came across a system where the MS Office files were located on drive E!
Is there any VBA trick to quickly locate the MS Office directory? I can always do a VBA search for the directory but I know there are API calls to find the Windows directory and I wonder if anyone has a quick way of finding the MS Office directory?
Thanks in advance.
Paul
Code:
With ActiveWorkbook.VBProject.References
.Remove ThisWorkbook.VBProject.References("Microsoft Outlook 10.0 Object Library")
strReference = "c:\program files\microsoft office\office10\msoutl.olb"
.AddFromFile strReference
End With
This has worked fine until I came across a system where the MS Office files were located on drive E!
Is there any VBA trick to quickly locate the MS Office directory? I can always do a VBA search for the directory but I know there are API calls to find the Windows directory and I wonder if anyone has a quick way of finding the MS Office directory?
Thanks in advance.
Paul