LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with macros assigned to toolbar buttons

Greg,
Thanks for the advice.
Since I already had an Auto_Close event to turn off the
toolbar visibility, I just changed the *.visibility=false
to *.delete.
Worked like a champ. Again, Thanks.

Rich

-----Original Message-----
I believe this is usually resolved by having code in the
Workbook_Open event that programmatically creates a
temporary custom toolbar (Temporary parameter set to
True). The macros are also assigned to the buttons at

the
same time. Because its status is set to Temporary, when
the workbook is closed it automatically deletes the

custom
toolbar. The Workbook_Open event code automatically
creates it again when it is opened. The same holds for
any copy made of the workbook. So the referenced macros
for the toolbar buttons always point to that workbook.

The second method is to create the toolbar and then

attach
it to the workbook (Tools|Customize|Toolbars tab|Select
toolbar|Attach option). Then use the

Workbook_BeforeClose
event or AutoClose macro to delete the toolbar on close.
When the workbook is subsequently opened and Excel cannot
find the toolbar because it has been deleted then it will
recreate the toolbar according to its status when it was
attached including macro references. This is true for
copies of the workbook also.

An important point is that attached toolbars are not
updated after being attached. So changes made to an
attached toolbar will not take effect. To make changes

to
an attached toolbar, unattach it, make the changes and
reattach it.

Regards,
Greg


 
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 2003 Custom toolbar problem saving new buttons Karen O Excel Discussion (Misc queries) 6 June 23rd 09 10:42 PM
Assigning Macros to Toolbar buttons JMay Excel Discussion (Misc queries) 1 July 24th 07 07:22 PM
Macro assigned to Toolbar problem JHL Excel Discussion (Misc queries) 2 March 22nd 07 11:44 PM
How can you replicate macros for buttons on the Standard toolbar? Suzi Excel Discussion (Misc queries) 1 February 16th 07 09:53 PM
Why does macros assigned to a toolbar lose its link when saved as Elsa Excel Discussion (Misc queries) 3 October 18th 05 09:48 PM


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