E
eklarsen
Using John Walkenbachs book I used the following code;
Dim InstalledProperly As Boolean
Private Sub Workbook_AddinInstall()
InstalledProperly = True
End Sub
Private Sub Workbook_Open()
If Not ThisWorkbook.IsAddin Then Exit Sub
If Not InstalledProperly Then
' Add it to the AddIns collection
If Not *InAddInCollection*(ThisWorkbook) Then _
AddIns.Add Filename:=ThisWorkbook.FullName
' Install it
AddInTitle = GetTitle(ThisWorkbook)
Application.EnableEvents = False
AddIns(AddInTitle).Installed = True
Application.EnableEvents = True
' Inform user
Msg = ThisWorkbook.Name & _
"has been installed as an add-in."
Msg = Msg & _
"Use the Tools Add-Ins command to uninstall it."
MsgBox Msg, vbInformation, AddInTitle
Call CreateMenu
End If
End Sub
When it runs I get "Compile Error:
Sub or Function not defined and it highlights the "InAddInCollection I
have bolded above. I want this to install properly no matter if the
user double clicks or file opens the file.
Any thoughts?
Dim InstalledProperly As Boolean
Private Sub Workbook_AddinInstall()
InstalledProperly = True
End Sub
Private Sub Workbook_Open()
If Not ThisWorkbook.IsAddin Then Exit Sub
If Not InstalledProperly Then
' Add it to the AddIns collection
If Not *InAddInCollection*(ThisWorkbook) Then _
AddIns.Add Filename:=ThisWorkbook.FullName
' Install it
AddInTitle = GetTitle(ThisWorkbook)
Application.EnableEvents = False
AddIns(AddInTitle).Installed = True
Application.EnableEvents = True
' Inform user
Msg = ThisWorkbook.Name & _
"has been installed as an add-in."
Msg = Msg & _
"Use the Tools Add-Ins command to uninstall it."
MsgBox Msg, vbInformation, AddInTitle
Call CreateMenu
End If
End Sub
When it runs I get "Compile Error:
Sub or Function not defined and it highlights the "InAddInCollection I
have bolded above. I want this to install properly no matter if the
user double clicks or file opens the file.
Any thoughts?