hatman
Well-known Member
- Joined
- Apr 8, 2005
- Messages
- 2,664
So I'm automating Project from Excel. Really just extracting data in a readonly mode. I have a great batch of code that I developed on my machine, with early bound objects. I went ahead and determined from the References list, what file housed the project Object Library, and copied it onto a network drive here. The thought being that I could late bind my objects, remove the library reference from teh file, and if someone tries to use this particular feature, but doesn't have the object library installed, I could detect this, and programmatically load the library onto their machine.
Boy, was I disappointed. Not only is the code not able to "register" the library file, to be available to Excel, but even manually browsing to the file in the References dialog doesn't seem to help. Am I missing other DLL's that are needed to make sense of teh library file? Anyone have any thoughts?
Boy, was I disappointed. Not only is the code not able to "register" the library file, to be available to Excel, but even manually browsing to the file in the References dialog doesn't seem to help. Am I missing other DLL's that are needed to make sense of teh library file? Anyone have any thoughts?
Rich (BB code):
Function Verify_Install_Project_Library() As Boolean
Const Project_Library_File As String = "MSPRJ.OLB"
Const Source_Library_Path As String = "\\huswlf0q\Groups\ACE\Lab Status Monitors\Sandbox\Template Folder\Support_DLLs\"
Dim Comm_Files_Path As String
Dim Microsoft_Shared_Files_Path As String
Dim In_Prog_Files As Boolean
Dim In_Common_Files As Boolean
Dim In_Source_Location As Boolean
Verify_Install_Project_Library = False
Comm_Files_Path = Environ("CommonProgramFiles") & "\"
Microsoft_Shared_Files_Path = Environ("ProgramFiles") & "\Microsoft Office\Office12\"
In_Common_Files = Not Dir(Comm_Files_Path & Project_Library_File) = ""
In_Prog_Files = Not Dir(Microsoft_Shared_Files_Path & Project_Library_File) = ""
If In_Common_Files Or In_Prog_Files Then
Verify_Install_Project_Library = True
Exit Function
End If
In_Source_Location = Not Dir(Source_Library_Path & Project_Library_File) = ""
If Not In_Source_Location Then
Exit Function
End If
FileCopy Source_Library_Path & Project_Library_File, Comm_Files_Path & Project_Library_File
In_Common_Files = Not Dir(Comm_Files_Path & Project_Library_File) = ""
If Not In_Common_Files Then
Exit Function
End If
Shell "regsvr32.exe " & Chr(34) & Comm_Files_Path & Project_Library_File & Chr(34)
Verify_Install_Project_Library = True
End Function