Hello,
In an .xla file, I am trying to pass an argument to a subroutine via .OnAction property of CommandBars(1).Controls.Add.
This is what I have and it runs fine
With newMenu.Controls.Add(Type:=msoControlButton, ID:=1)
.Caption = "Transpose Working Forecast"
.OnAction = "Transpose.xla!CheckSum()"
.Enabled = False
.Style = msoButtonCaption
End With
however, if I specify an argument in CheckSum(), then I get a Macros Disabled error message. With no argument specified/required it runs fine. I've tried passing a dimmed variable, hard coding using "'" around the string etc..., nothing works.
Thanks for your help
Mickey
In an .xla file, I am trying to pass an argument to a subroutine via .OnAction property of CommandBars(1).Controls.Add.
This is what I have and it runs fine
With newMenu.Controls.Add(Type:=msoControlButton, ID:=1)
.Caption = "Transpose Working Forecast"
.OnAction = "Transpose.xla!CheckSum()"
.Enabled = False
.Style = msoButtonCaption
End With
however, if I specify an argument in CheckSum(), then I get a Macros Disabled error message. With no argument specified/required it runs fine. I've tried passing a dimmed variable, hard coding using "'" around the string etc..., nothing works.
Thanks for your help
Mickey