Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Using Excel 2003, I'm trying to write a module that will dynamically create a toolbar and buttons when the workbook loads, destroy the toolbar when it's closed, and handle the clicking on the buttons on it. I have already written all the code for creating a toolbar and destroying the toolbar. What I'm struggling with is a way to handle the clicking of the command buttons on the toolbar. I know there's an "onAction" property that I can point to a macro, but I'd like my module to have a procedure called "HandleCMDClick" or something, and be able to handle the clicking of any button. I've already tried including a parameter at the end of the "onAction" property, i.e. "modToolbar.HandleCMDClick("Button1")", but that doesn't work; it doesn't recognize that as a call to "HandleCMDClick". Is there a way, in the "HandleCMDClick" procedure, that I can tell which button was clicked? Anyone have any insight they can lend? Thanks much. -- nullGumby ------------------------------------------------------------------------ nullGumby's Profile: http://www.excelforum.com/member.php...o&userid=36128 View this thread: http://www.excelforum.com/showthread...hreadid=559033 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
use
Commandbars.ActionControl to get a reference to the control triggering the action. -- Regards, Tom Ogilvy "nullGumby" wrote: Using Excel 2003, I'm trying to write a module that will dynamically create a toolbar and buttons when the workbook loads, destroy the toolbar when it's closed, and handle the clicking on the buttons on it. I have already written all the code for creating a toolbar and destroying the toolbar. What I'm struggling with is a way to handle the clicking of the command buttons on the toolbar. I know there's an "onAction" property that I can point to a macro, but I'd like my module to have a procedure called "HandleCMDClick" or something, and be able to handle the clicking of any button. I've already tried including a parameter at the end of the "onAction" property, i.e. "modToolbar.HandleCMDClick("Button1")", but that doesn't work; it doesn't recognize that as a call to "HandleCMDClick". Is there a way, in the "HandleCMDClick" procedure, that I can tell which button was clicked? Anyone have any insight they can lend? Thanks much. -- nullGumby ------------------------------------------------------------------------ nullGumby's Profile: http://www.excelforum.com/member.php...o&userid=36128 View this thread: http://www.excelforum.com/showthread...hreadid=559033 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Tom Ogilvy, Works prefectly! Thanks a lot -- nullGumb ----------------------------------------------------------------------- nullGumby's Profile: http://www.excelforum.com/member.php...fo&userid=3612 View this thread: http://www.excelforum.com/showthread.php?threadid=55903 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
EXCEL: put_DisplayAlerts fails if user is entering data and clicks toolbar button | Excel Programming | |||
Toolbar associated with fill handle | Excel Discussion (Misc queries) | |||
Invalid Picture Error when user clicks on toolbar | Excel Programming | |||
How to create a URL and when user clicks it to open a Excel workbook | Excel Programming | |||
create module | Excel Programming |