View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
JoeAdidas21 JoeAdidas21 is offline
external usenet poster
 
Posts: 4
Default Workbook name in VBA doesn't match filename.xls

I have a workbook named ABC.xls, in that workbook are several macros that
reference the currently named workbook ... ABC.xls.
Now, my users rename the workbook to 123.xls.
When they go to run the macro in the newly named 123.xls workbook the macro
fails because there are references to the old workbook name of ABC.xls.
Is there a way to avoid this .. one note, having the user NOT rename the
workbook is not an option.
Is there a way to use a variable to reference the workbook no matter what it
is named, pehaps ?
Thanks in advance,
Joe