#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable running of SelectionChange macro when in another macro? Tonso Excel Discussion (Misc queries) 6 March 21st 10 06:50 PM
Pop-up when running a macro tom Excel Discussion (Misc queries) 5 April 2nd 07 08:55 AM
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
Running one macro from another Megadrone Excel Worksheet Functions 4 December 5th 06 04:54 AM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM


All times are GMT +1. The time now is 10:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"