I am inserting shapes into a sheet and I want an OnAction on each shape with a parameter (which is a variable) to call another sub.
The code runs fine and inserts the OnAction:
The code for the sub in my personal workbook:
When I try and click one of the shapes though, I get:
Cannot run the macro "PERSONAL.XLSB!MyMacro VariableString". The macro may not be available in this workbook or all macros may be disabled.
Anybody know whats going on here?
Thanks!
The code runs fine and inserts the OnAction:
Code:
With tempShape
.OnAction = "'PERSONAL.XLSB!MyMacro " & myVariable & "'"
End With
The code for the sub in my personal workbook:
Code:
Public Sub MyMacro(VariableName As String)
'code here
End Sub
When I try and click one of the shapes though, I get:
Cannot run the macro "PERSONAL.XLSB!MyMacro VariableString". The macro may not be available in this workbook or all macros may be disabled.
Anybody know whats going on here?
Thanks!