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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a Macro to a Menu

Status
Not open for further replies.

JoeF

Technical User
Nov 30, 2000
54
US
In the prior version of Excel, I could add a command to a menu in order to run a macro and the command would only be present when the file owning the macro was open. In Office XP, I can't figure out how to keep the menu item related to the file. Once I set it up, it's always there.
 
When you created the macro, did you store it in THAT workbook, or in your personal.xls file?

Go to the folder on your hard drive called XLSTART. If you've got a personal.xls file in there, it probably contains the code. You need to move that code into the specific file using the VB Editor (open file, hit Alt-F11). Then, you can remove the code from personal.xls or completely delete the personal.xls file while Excel is closed. Brainbench MVP for Microsoft Word
techsupportgirl@home.com
 
The macro is stored in the workbook, it is not in my personal file. I am talking about a customized menu option that I created to run the macro. I set it up so I can run a macro from under the tools menu. My problem is that the menu option doesn't go away when I close the file containing the macro.

The files I created in Excel 7.0 work like this (even when converted to XP), but I can't figure out how to make new files in Office XP that work the same way.
 
Oh. Generally, when I add a menu to a workbook, I have the code load the menu (unless it finds it loaded already) on the "open", then have the code unload the menu on the "before close" in VBA.

Perhaps you have code that is no longer any good in XP. There were some changes...

Let me know if you still need help. I think I have a workbook that does it, or a link to Technet that explains how. Brainbench MVP for Microsoft Word
techsupportgirl@home.com
 
I actually didn't do it with code, but I'll do it with code if you send me that link - thanks.

I had done it through the menu editor in the old Excel. When I convert the files over to XP, they still only show the customized menu option when the file is open. I just can't figure out what is making the files work that way and I can't reproduce it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top