A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro not running



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2010, 09:17 AM posted to microsoft.public.excel.misc
Grey Old Man[_2_]
external usenet poster
 
Posts: 28
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  
Old May 7th, 2010, 02:19 PM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 19,791
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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:35 AM.


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