Third Party Object Library Install

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?

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
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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