View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Argument with onAction in a menu.

Zeth,

This is the command format

.OnAction = "'" & ThisWorkbook.Name &
"'!'Export_Data ""abc""'"

Note the ' and " in places.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Zeth Larsson" wrote in message
...
Hi out there!

I'v create a menu in a XL worksheet with commands like
With Application.CommandBars.Add("Certifiering", , False,
True)
.Visible = True
.Position = msoBarLeft
With .Controls
With .Add(msoControlPopup)
.Caption = "&CertDatabas"
With .Controls
With .Add(msoControlButton)
.Caption = "Spara öppen kopia"
.OnAction = "Export_Data"
End With

Now I want to execute a sub from a .OnAction like

With .Add(msoControlButton)
.Caption = "Spara öppen kopia"
.OnAction = "Export_Data argValue"
End With

Would realy appreciate a hint on how to do that, if it
can be done!

Regards
Zeth