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
 

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

sunnyland

Well-known Member
Joined
Jan 27, 2006
Messages
912
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
 

Watch MrExcel Video

Forum statistics

Threads
1,112,798
Messages
5,542,562
Members
410,560
Latest member
1ndependent
Top