How to stop having to re-assign macros every time you open a workbook???

  • Thread starter Thread starter Simon Lloyd
  • Start date Start date
S

Simon Lloyd

Can anyone tell me how to be able to open a workbook that contain
macro's assigned to buttons on different networked machines withou
having to re-assign the macro's every time, it's getting annoying!

Every time i or a user open the workbook on a different machine i hav
to re-assign macro's to the buttons again.

Can anyone help?

Simo
 
Tom i assumed you can do that but wouldn't know how to do it!

Simon
 
applicaton.CommandBars("Custom1").Controls("ABCD").OnAction = "Macro1"

assuming macro1 is in the workbook where the above is run.

so you would set up a line for each control on you custom commandbar.

do it in the workbook_open event. It is often useful to have you code
actually build the commandbar.

Here is an article about creating commandbars with code:
http://msdn.microsoft.com/library/techart/ofcmdbar.htm


other references:

http://support.microsoft.com/default.aspx?scid=kb;en-us;830502&Product=xlw
How to customize menus and menu bars in Excel


http://support.microsoft.com/?id=159619
XL97: Sample Macros for Customizing Menus and Submenus

http://support.microsoft.com/?id=213550
XL2000: Sample Macros for Customizing Menus and Submenus


http://support.microsoft.com/default.aspx?scid=kb;en-us;166755
File Title: Customizing Menu Bars, Menus, and Menu Items in Microsoft(R)
Excel 97
File Name: WE1183.EXE
File Size: 58041 bytes
File Date: 06/20/97
Keywords: kbfile kbappnote
Description: This Application Note can help you learn techniques for writing
Visual Basic(R) for Applications code to customize menus in Microsoft Excel
97. This Application Note contains code examples that you can use with the
following elements: menu bars, menus, menu items, submenus, and shortcut
menus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top