SaveAs?

  • Thread starter Thread starter QB
  • Start date Start date
Q

QB

I need to save copy of a workbook under diferrent names...

I currently am using the SaveAs method but this switches to the newly
created file and I would like to remain within the original file. How can
this be done.

Also, is it possible to create these copies without copying the vba in the
main file, just the worksheet data?

Thank you for the help,

QB
 
--Have you tried Activeworkbook.SaveCopyAs

--If you are using 2007 save as .xlsx

If this post helps click Yes
 
The FileCopy command should help you do what you need ... press F1 in
the VBE and then search for FileCopy. You can change the name of the
file multiple times if you need. Note, however, that attempting to
copy a file that's currently open will result in an error.

On your 2nd question, I'm sure that searching the forums for some
variation of 'delete VBA' will provide many solutions ...

ray
 
You can look at .savecopyas in vba's help.

But that saves an identical version of the current state of the workbook --
including code.

You could remove the code (if all the security settings are ok) using techniques
from Chip Pearson's site:
http://www.cpearson.com/excel/vbe.aspx

If you share with others, you may find it easier to create a new workbook, copy
the data (formulas or values or both) to the new workbook and then save that.

Maybe even have a template that has all the layouts of each sheet (page setup,
filters, freeze panes, ...) and create a new workbook based on that template
(which has no code).

Then save that after you've copied what you want into it.
 
Back
Top