ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .Parameter property of CommandBarButton (https://www.excelbanter.com/excel-programming/362113-parameter-property-commandbarbutton.html)

Gregory Kip[_3_]

.Parameter property of CommandBarButton
 
Hello,

Running Excel 2000 I dynamically create a command bar button but cannot
seem to make its .Parameter property work.

Set myCBB = CommandBars("Standard").Add (etc...)

with myCBB
.Parameter = "Macro ""<Module_Name.<Sub_Name"""
end with

I run this code and then click the button and the "Assign Macro" dialog
box appears. Please help!

-Greg



Harald Staff

.Parameter property of CommandBarButton
 
Hi Greg

Sounds like you want the .OnAction property, not the .Parameter.

with myCBB
.OnAction = Module_Name.Sub_Name
end with

HTH. Best wishes Harald

"Gregory Kip" skrev i melding
...
Hello,

Running Excel 2000 I dynamically create a command bar button but cannot
seem to make its .Parameter property work.

Set myCBB = CommandBars("Standard").Add (etc...)

with myCBB
.Parameter = "Macro ""<Module_Name.<Sub_Name"""
end with

I run this code and then click the button and the "Assign Macro" dialog
box appears. Please help!

-Greg





Gregory Kip[_3_]

.Parameter property of CommandBarButton
 
Tried it and it works. I am baffled, though, because I've been using
..Parameter in MSProject 2003. Maybe an update or something. Thanks again!

"Harald Staff" wrote in message
...
Hi Greg

Sounds like you want the .OnAction property, not the .Parameter.

with myCBB
.OnAction = Module_Name.Sub_Name
end with

HTH. Best wishes Harald

"Gregory Kip" skrev i melding
...
Hello,

Running Excel 2000 I dynamically create a command bar button but

cannot
seem to make its .Parameter property work.

Set myCBB = CommandBars("Standard").Add (etc...)

with myCBB
.Parameter = "Macro ""<Module_Name.<Sub_Name"""
end with

I run this code and then click the button and the "Assign Macro"

dialog
box appears. Please help!

-Greg








All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com