Hi there,
I'm having some trouble with an Add-in which calls a UserForm. When selecting the Add-in, I receive the following error: "Cannot run the macro "DATA CHECKER ADD IN.xlam'!Run_ShowUserForm'. The macro may not be available in this workbook or all macros may be disabled.
Below is my code:
Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Grapher+").Delete
Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
With cControl
.Caption = "Data Checker"
.Style = msoButtonCaption
.OnAction = "Run_ShowUserForm" 'Macro stored in a Standard Module
End With
On Error GoTo 0
End Sub
Sub Workbook_Close()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Data Checker").Delete
On Error GoTo 0
End Sub
Sub ShowUserForm()
Formula_Selection.Show
End Sub
I've tried adding the ShowUserForm macro in a module and in "ThisWorkbook" but neither works.
Thanks for your help!
Jaime
I'm having some trouble with an Add-in which calls a UserForm. When selecting the Add-in, I receive the following error: "Cannot run the macro "DATA CHECKER ADD IN.xlam'!Run_ShowUserForm'. The macro may not be available in this workbook or all macros may be disabled.
Below is my code:
Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Grapher+").Delete
Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
With cControl
.Caption = "Data Checker"
.Style = msoButtonCaption
.OnAction = "Run_ShowUserForm" 'Macro stored in a Standard Module
End With
On Error GoTo 0
End Sub
Sub Workbook_Close()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Data Checker").Delete
On Error GoTo 0
End Sub
Sub ShowUserForm()
Formula_Selection.Show
End Sub
I've tried adding the ShowUserForm macro in a module and in "ThisWorkbook" but neither works.
Thanks for your help!
Jaime