Additional Controls

deepheat101

Board Regular
Joined
Jul 26, 2006
Messages
138
Hello All

I am using the following code to verify that the two additional controls that on of my UserForms uses are loaded and available...

Code:
Private Sub Workbook_Open()
    
    If AddIns("LANDesk Date Control").Installed = False Then
        Application.AddIns.Add ("LANDesk Date Control")  '  <<<<<
    End If

    If AddIns("LANDesk Time Control").Installed = False Then
        AddIns("LANDesk Time Control").Installed = True
    End If

End Sub

...however, I get a "subscript out of range" error at the line indicated by the "<<<<<".

Any suggestions will be much appreciated....

Many thanks in advance
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hie,

I couldn't test using the same addin as I don't have it however I used solver and lookup instead and it works. To test untick manually solver and lookup via the menu then run it and see if this work:
Now you will have to use the name of the file as the addin name with extension. To check the addin name run displayaddins


Code:
Private Sub displayaddins()
    Dim myaddin As AddIn
    For Each myaddin In Application.AddIns
    MsgBox myaddin.Name
    Next
     Set myaddin = Nothing
End Sub


To install the addin.
Code:
Private Sub Workbook_Open()
    Dim myaddin As AddIn
    For Each myaddin In Application.AddIns
    Select Case myaddin.Name
    Case "SOLVER.XLA", "LOOKUP.XLA"
    If myaddin.Installed = False Then
    myaddin.Installed = True
    End If
    End Select
    Next
    Set myaddin = Nothing
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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