Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Office 9 library

Microsoft Office 9 object library

I cannot understand what fails to my code for creating a reference to the Microsoft Object library.it seems to me that the code is all right, the path is the same
but my code does not produce a reference to this library.
Could someone help me ?

Function AddOffice9() As Boolean
Dim ref As Reference, strFile As String
strFile = "C:\Program Files\Microsoft Office\Office\MS09.DLL"
On Error GoTo Error_AddOffice9
Set ref = References.AddFromFile(strFile)
AddOffice9 = True
Exit_AddOffice9:
Exit Function
Error_AddOffice9:
'MsgBox Err & ": " & Err.Description
AddOffice9 = False
Resume Exit_AddOffice9
End Function
[724 byte] By [peljo] at [2007-11-11 8:45:32]
# 1 Re: Office 9 library
I've not sure you can add a reference from code. In VB, I use the Project -> References... menu. In MS Office, I use Tools -> References... in the VB Editor.
Phil Weber at 2007-11-11 17:25:04 >