Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Graphic 1

Status
Not open for further replies.

scohan

Programmer
Dec 29, 2000
283
US
I've copied a macro module from one Excel file to another. After opening the source file and clicking the 'enable macros' pushbutton on the popup window that pops up, a menu is added to the menubar. In the target file, the menu is not added to the menubar after clicking the 'enable macros' pushbutton. I've looked over the macro code, but I can't figure out what causes the macro to execute upon startup in the source file. There's also a macro that removes the menu from the menubar when the source file is closed. Any ideas on how I can get these macros to run automatically in the target file? Thanks.
 
For macros to run in any file, you need to copy them to the file. Open both files. Hit Alt-F11. In the upper, left-hand corner, you should see something that looks like Windows Explorer. Make sure you click on all + signs so that you can see what's in each file/module/sheet. Whatever item is selected (double-clicked) is the code you should see on the right.

A macro that runs automatically on open/close is called Auto_open or Workbook_open/Workbook_close...
techsupportgirl@home.com
Brainbench MVP for Microsoft Word at
 
Thanks, renaming the macros to Auto_open and Auto_close worked like a charm!

BTW, I have no idea why the title of this post is Excel Graphic instead of Excel Macros. Sigh...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top