views:

1787

answers:

2

I''m looking for a vba macro that will make a copy of the current Excel 2007 macro-enabled workbook with the name I specify as an Excel 2003 macro-free document. It should also keep the current workbook open and in the Excel 2007 format (so save-as wouldn't work).

I can't figure out how to do the copy operation...

+2  A: 

It's much, much easier to do a save as.

Why does it have to stay open? - you can simulate it by:

  • Doing a Save As to a new file
  • Close the copy
  • Re-open the original

As far as removing the code look at these questions:

http://stackoverflow.com/questions/704759/how-to-remove-excel-vba-code-modules-when-spreadsheet-opened-closed

http://stackoverflow.com/questions/680875/macro-to-save-active-sheet-as-new-workbook-ask-user-for-location-and-remove-macr

DJ