macros don't work when workbook saved under new name

E

eric

i have a 15 page workbook in which i created a customized
toolbar. in the tool bar, i've created custom buttons to
help the user navigate the workbook. the buttons contain
very simple macros which simply display the appropriate
sheet when the button is pressed.

when i save the workbook under a different name, i notice
that the macros seem to only work under the new workbook
name. after i open the original workbook and click on a
custom button which contains the macro i recieve the
following error:

'newfile.xls' could not be found. check the spelling of
the file name, and verify that the file location is
correct. if you are trying to open the file from your
list of most recently used files on the File menu, make
sure the file has not been renamed, moved, or deleted.

to record the macros, i simply started the macro recorder
and clicked on the appropriate sheet tab, stopped the
macro, and then assigned that macro to a button.

when i look at the macro from the 'tools' menu, the macro
does not appear to have any sheet or workbook
identifiers, leaving me to think it is workbook
agnostic. but when i right click the custom button,
select 'customize', 'modify selection', 'assign macro', i
see the following:

'C:\Documents and Settings\User\Desktop\newfile.xls'!
gotoLog

why doesn't excel localize the macros to operate in the
file that is open or saved? i'd appreciate any help to
keep these macros pointed to the sheet that is opened.

thanks...
 

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