The big problem I have is invoking a user-defined class method from an .onaction assignment in a control. I researched this in various resources’, but no luck. The following code executes fine, but when the button is pressed you get the following error
"Cannot run the macro “Pinger_57(7).xlsm.’ms.msg’. The macro may not be available in this workbook or all macros may be disabled"
Im sure that it is a syntax error ,but i cannot find the answer from the usual resources.
'CLASS
Private Name As String
Property Let IniDataScape(cName As String)
Name = cName
ActiveSheet.Buttons.Add(768, 312.6, 94.8, 31.2).Select
Selection.OnAction = "me.msg"
End Property
Public Sub msg()
MsgBox (Name)
End Sub
'END CLASS
Sub testObject()
Dim myDataScape As New DataScape
myDataScape.IniDataScape = "One"
End Sub
Sub testObject2()
Dim myDataScape As New DataScape
myDataScape.IniDataScape = "Two"
myDataScape.msg
End Sub
Thanks,
Anthony
"Cannot run the macro “Pinger_57(7).xlsm.’ms.msg’. The macro may not be available in this workbook or all macros may be disabled"
Im sure that it is a syntax error ,but i cannot find the answer from the usual resources.
'CLASS
Private Name As String
Property Let IniDataScape(cName As String)
Name = cName
ActiveSheet.Buttons.Add(768, 312.6, 94.8, 31.2).Select
Selection.OnAction = "me.msg"
End Property
Public Sub msg()
MsgBox (Name)
End Sub
'END CLASS
Sub testObject()
Dim myDataScape As New DataScape
myDataScape.IniDataScape = "One"
End Sub
Sub testObject2()
Dim myDataScape As New DataScape
myDataScape.IniDataScape = "Two"
myDataScape.msg
End Sub
Thanks,
Anthony