If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro not running
I have recorded a macro in an Excel 2002 template, created a Custom Menu
Item, and assigned the macro name to it. When I open the template (which creates the file “name1.xls”) and run the macro from the Custom Menu Item, it fails with the message “name1.xls could not be found”. However, when I run from ‘Tools | Macro | Run’ it works OK. I'm confused. Any help would be appreciated. |
#2
|
|||
|
|||
Macro not running
First, if you really created a template workbook, then the workbook's that
created isn't name1.xls -- it won't have an extension until you save it to disk. It should be just name1 or name11 or name12 or ...) But I wouldn't put the macro in a template workbook. When you start the new workbook based on this template, the customized menu macro will still point to the .xls file (where you did your testing). You could either have code that fixes the problem, but even easier would be to uses an addin that creates the menu item and destroys it when you close excel. Saved from a previous post: For additions to the worksheet menu bar, I really like the way John Walkenbach does it in his menumaker workbook: http://j-walk.com/ss/excel/tips/tip53.htm Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) In xl2007, those toolbars and menu modifications will show up under the addins. And if you use xl2007: If you want to learn about modifying the ribbon, you can start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm And Bob Phillips shows a way to use a wrapper so that it can work in both xl2003 and xl2007. http://msmvps.com/blogs/xldynamic/ar...me-simple.aspx Grey Old Man wrote: I have recorded a macro in an Excel 2002 template, created a Custom Menu Item, and assigned the macro name to it. When I open the template (which creates the file “name1.xls”) and run the macro from the Custom Menu Item, it fails with the message “name1.xls could not be found”. However, when I run from ‘Tools | Macro | Run’ it works OK. I'm confused. Any help would be appreciated. -- Dave Peterson |
Thread Tools | |
Display Modes | |
|
|