ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying Excel files and Macro problems (https://www.excelbanter.com/excel-programming/294082-copying-excel-files-macro-problems.html)

No Name

Copying Excel files and Macro problems
 
Whenever I copy an Excel file and later try to use the Macro's. They always
point back to the original file and I get an error about opening the same
file twice. Is there a way to program an update to the macros on the new
file or to save the file without referrencing the original macro's file?

Thanks,

Jesse



Bill Renaud[_2_]

Copying Excel files and Macro problems
 
If you are using macros across several workbooks, then it might be time to
consider putting the macros in an add-in.

Or, until your code is fully debugged, put all of the macros into a blank
workbook with a name similar to the main macro. Make sure that any toolbar
or custom menu used to call (start execution of) the macros is attached to
the new workbook, hide the workbook window, then save the workbook from the
VBE (Visual Basic Editor). Delete the custom toolbar from the Excel toolbars
area before re-opening the workbook with the macros in it, otherwise the
existing toolbar buttons will still point to the original workbook with data
and macros in it.

You may have some editing work to do to make sure that your macros still
reference the correct workbook when running.

(Just a quick suggestion, without knowing more details.)
--
Hope this helps,
Bill


wrote in message
om...
Whenever I copy an Excel file and later try to use the Macro's. They

always
point back to the original file and I get an error about opening the same
file twice. Is there a way to program an update to the macros on the new
file or to save the file without referrencing the original macro's file?

Thanks,

Jesse






All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com