LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do I refer to a custom toolbar button?

I'm just beginning to enter the world of VBA programming, trying to do
something in Excel.

I created a Forms-control button on a worksheet, and wrote a macro for it
within a module. (I.e., the button_click event is within a module.)

I then decided I wanted the button to be accessible and visible from every
worksheet in the workbook. Not seeing any easy or obvious way to have Excel
automatically keep the button on all worksheets (other than to manually add
it to every sheet myself, and make sure it was added programmatically if the
user added a new sheet), I created a toolbar button and associated the
toolbar button with the same macro.

Here's where I'm stumped:
If I'm in the module that contains the macro, I can enable or disable the
button by writing button1.enabled = true (or false).

From the workbook or any other sheet or module, I cannot figure out how to
identify or reference the button.

I tried creating Public functions within the module that handle the
enable/disable, but they still fail with an 'Object required' error when
called from outside of the module.

Anybody here know how I can get this working?

Thanks

 
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
adding custom images to a button on custom toolbar Mousam Excel Programming 1 July 13th 07 04:28 PM
Custom button on toolbar Jack Excel Programming 1 February 7th 06 09:09 PM
single button on a custom toolbar Randy Starkey Excel Programming 1 March 21st 05 05:42 PM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM
Can't delete custom button and toolbar Ron de Bruin Excel Programming 1 March 1st 04 09:46 PM


All times are GMT +1. The time now is 03:12 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"