Buttons Fail After Moving File to Different Folder

G

Guest

I’ve created a custom toolbar with buttons, created and assigned macros to
the buttons. Clicking the buttons runs the macros as expected.

But I have a problem if I save the file (in FOLDER1 for my example), move
the file to another folder (FOLDER2) on the local hard drive using Windows
Explorer, and then open the file located in the new folder (FOLDER2). When I
click the buttons, a dialog box pops up saying that the macro can not be
found, with an error that references the original folder location (FOLDER1)
where the file/toolbar/macro was originally created and saved.

I’ve tried the following solutions, all of which have failed:
1. Saving the macros in the Personal Macro Workbook before saving and moving;
2. Attaching the toolbar to the file before saving and moving;
3. Consulted all of the HELP for macros and toolbars, but nothing is
mentioned about the limitations of toolbar macros working when moving a file
to another folder.

If I do a SAVE AS, save the file in different folder (FOLDER3), close Excel
completely, restart Excel, open the new file now located in the new folder
(FOLDER3), clicking the buttons works. But if I then close the new file,
open the original file in the original folder (FOLDER1) and click the
buttons, the error now reads that the macro can not be found and references
FOLDER3.

It seems as if the toolbar button macros will only work when the file is
opened in the folder where it was last saved, not moved to.

I really need to be able to move the file around to different folders using
Windows Explorer, plus email the file to others, and have the buttons work
properly. What am I missing? Thanks in advance.

Dave
 
T

Tom Ogilvy

Place the macros in the workbook
In the workbook open event of the workbook, delete any existing versions of
the menu; then Create the menu and assign the macros in the current
location.
 

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