Recorded macro: What happens if I change filename?

  • Thread starter Thread starter mas_it_2000
  • Start date Start date
M

mas_it_2000

Hi everyone,


Say I have a recorded macro named "Base" and linked it to a button in a
an excel workbook named ABC.xls

Later, say I changed the file name to DEF.xls


Now, when I click on the button to execute, I get "out of range"
error and the file close!


How can I make the macro name is independent of the file name; so it
doesn't keep referring to the old file name?


Regards,
Mike
 
Hi Mike

two questions,
1) where are you saving the macro - is it in the ABC workbook or in your
personal workbook?
- if you want the macro to be available to a number of different workbooks
it needs to be in the personal macro workbook not in a specific workbook (it
can be in a specific workbook, but this workbook must be open if you want to
run the macro)

if that's not the problem
2) could you please copy & paste the code in a reply post so that we can see
where and how the filename is being used in the code

Regards
JulieD
 

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

Back
Top