Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Module, create toolbar/handle clicks


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Module, create toolbar/handle clicks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Module, create toolbar/handle clicks


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
EXCEL: put_DisplayAlerts fails if user is entering data and clicks toolbar button [email protected] Excel Programming 0 January 8th 06 08:05 AM
Toolbar associated with fill handle gina Excel Discussion (Misc queries) 1 September 3rd 05 01:46 AM
Invalid Picture Error when user clicks on toolbar David Welch[_2_] Excel Programming 1 March 24th 05 10:24 AM
How to create a URL and when user clicks it to open a Excel workbook Belinda Excel Programming 2 May 30th 04 01:06 PM
create module rick Excel Programming 1 April 19th 04 05:57 PM


All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"