Sub CommandButton1_Click()
Dim XLAFound As Boolean
Dim i As Integer
XLAFound = False
For i = 1 To AddIns.Count
If AddIns(i).Name = "DaySheet.xla" Then
XLAFound = True
End If
Next
If XLAFound Then
AddIns("DaySheet.XLA").Installed = True
Else
AddIns.Add(Filename:=ThisWorkbook.Path & "/" & "DaySheet.XLA", CopyFile:=True).Installed = True
End If
Application.ExecuteMacro "DaySheet.XLA!Module1!showdataentryform"
End Sub
And attaching it to the button - which of course, does not work. I was trying to call the macro
from code so I could make sure the XAL was loaded first. Is this possible?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.