Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Recorded macro: What happens if I change filename?

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

  #2   Report Post  
JulieD
 
Posts: n/a
Default

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



wrote in message
oups.com...
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



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

You could reassign the macro to the button each time the workbook is opened.

Or maybe just rename DEF.xls back to ABC.xls, then open ABC.xls and do a
File|SaveAs (instead of using windows explorer to rename the workbook).

If that doesn't work, post some more details. What kind of button? On a
worksheet from the Forms toolbar? Or on a toolbar?



wrote:

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM
Change Row Numbers in Formula with Macro Frank Excel Discussion (Misc queries) 3 January 4th 05 06:42 PM
Where to stick macro to change default comment font? [email protected] Excel Discussion (Misc queries) 1 January 1st 05 12:57 AM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM
Macro button colour change??? Beefyme Excel Worksheet Functions 1 November 19th 04 06:15 PM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"