ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs? (https://www.excelbanter.com/excel-programming/434435-saveas.html)

QB

SaveAs?
 
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

Jacob Skaria

SaveAs?
 
--Have you tried Activeworkbook.SaveCopyAs

--If you are using 2007 save as .xlsx

If this post helps click Yes
---------------
Jacob Skaria


"QB" wrote:

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


Ray

SaveAs?
 
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

QB

SaveAs?
 
Thank you for pointing me to this method. I will take a look.

QB





"Jacob Skaria" wrote:

--Have you tried Activeworkbook.SaveCopyAs

--If you are using 2007 save as .xlsx

If this post helps click Yes
---------------
Jacob Skaria


"QB" wrote:

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


Dave Peterson

SaveAs?
 
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.

QB wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 08:35 AM.

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