Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a procedure that takes a commandbar object as it's argurment:
Sub modify_insert_delete_buttons(cbar As CommandBar, Optional delete As Boolean = False) It modifies Excel's existing Insert Rows and Delete Rows buttons on various Excel commandbars including the Edit menu and the Cells right-click menu. In the procedure I need to use FindControl which seems to be only available with CommandbarPopups, not Commandbars. In order to pass the Edit menu to my routine I've done this in the calling procedu Dim cbar As CommandBar Set cbar = Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=30003).Controls(1).Parent 'Edit menu Is there a better way to do this, without calling the Parent of a Control on the Edit menu? It seems like the following should work, but it gives a type mismatch error: Set cbar = Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=30003) Again, the way I'm doing it works, I just wonder if there's a better way. thanks, Doug |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing a Function name as a procedure argument | Excel Programming | |||
Passing an array or recordset to a stored procedure | Excel Programming | |||
Passing Userform as an argument to a procedure | Excel Programming | |||
Passing properties to a procedure | Excel Programming | |||
Passing a Password to a VBA Procedure | Excel Programming |