Error message Macro cannot be found

  • Thread starter Hunter O'Connell
  • Start date
H

Hunter O'Connell

I created a toolbar for filtering columns. All macros are within the
appropriate modules within the document, the toolbar is attached, and
all macros work. However, when I try it on another computer, I get the
error message Macro cannot be found at [file path]. Sometimes the file
path cited is the location where I originally saved the file, and
sometimes it is the location where it is presently stored. That is,
sometimes the error cites the correct filepath. There is a Deactivate
event on close, to prevent the toolbar from displaying when another
Excel file is opened, and an Activate event on open, so that the
toolbar displays when the file is opened. Both events work. Any ideas?
Any help would be much appreciated.
 
H

Hunter O'Connell

Problem appears to be filepath when a tool is assigned to a macro. For
example, suppose I see '[filename]'![macroname] in the Macro name:
field (relative path).
If I move the file to my desktop, I will see 'C:\Desktop\[filename]'!
[macroname] (absolute path). Is there code to make the assigned macro
stick?
 
D

Dave Peterson

Personally, I wouldn't attach a toolbar to a workbook -- especially if you have
macros assigned to any of the options.

Instead, I'd create the toolbar on the fly (when the workbook opens or is
activated) and delete it when it's not required (when the workbook closes or is
deactivated).

If you think that this is something you want to try...

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

Problem appears to be filepath when a tool is assigned to a macro. For
example, suppose I see '[filename]'![macroname] in the Macro name:
field (relative path).
If I move the file to my desktop, I will see 'C:\Desktop\[filename]'!
[macroname] (absolute path). Is there code to make the assigned macro
stick?
I created a toolbar for filtering columns. All macros are within the
appropriate modules within the document, the toolbar is attached, and
all macros work. However, when I try it on another computer, I get the
error message Macro cannot be found at [file path]. Sometimes the file
path cited is the location where I originally saved the file, and
sometimes it is the location where it is presently stored. That is,
sometimes the error cites the correct filepath. There is a Deactivate
event on close, to prevent the toolbar from displaying when another
Excel file is opened, and an Activate event on open, so that the
toolbar displays when the file is opened. Both events work. Any ideas?
Any help would be much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top