From: Grey Old Man on 7 May 2010 04:17 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.
From: Dave Peterson on 7 May 2010 09:19 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/archive/2010/03/27/deploy-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
|
Pages: 1 Prev: hello everybody.. question about .CSV files.. Next: *****still can't post a question***** |