Need something like Excel's SaveCopyAs method

T

tbone

I'm familiar with Excel 2003 VBA, and I'm starting to apply some of my
logic to Project 2003.

In Excel, I use SaveCopyAs in the Workbook Open event to create a
backup copy once per day with the date included in the filename. This
allows a backup trail if needed, and the logic purges after so many
backup files.

SaveCopyAs provides a way to save the current workbook to a file with
a different name while leaving the name unchanged in the current
workbook. I don't see a similar functionality in Project.

I kludged around it by reopening the original project file after doing
a FileSave, then closing the (renamed) backup file right in the Open
event after purging old backups. The reloaded project now sees that a
backup was already done today, so it exits the Open event routine. The
only problem with this is that I get the macro security warning twice.

Alternatives enthusiastically entertained.

Thanks
tbone
 
R

Rod Gill

Hi,

Firstly, we are desperately trying to get this group closed so please,
please use the project.developer group from now on.

To answer your question, there isn't an easy way apart from what you have
done with saveas followed by re-opening the original.

You can set macro security to low and/or experiment with using
displayalerts=false to hide the messages.

Alternatively run a macro in a separate project that loops thru all .mpp
files in a list of folders using the dir method and use filecopy to make
backups.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




tbone said:
I'm familiar with Excel 2003 VBA, and I'm starting to apply some of my
logic to Project 2003.

In Excel, I use SaveCopyAs in the Workbook Open event to create a
backup copy once per day with the date included in the filename. This
allows a backup trail if needed, and the logic purges after so many
backup files.

SaveCopyAs provides a way to save the current workbook to a file with
a different name while leaving the name unchanged in the current
workbook. I don't see a similar functionality in Project.

I kludged around it by reopening the original project file after doing
a FileSave, then closing the (renamed) backup file right in the Open
event after purging old backups. The reloaded project now sees that a
backup was already done today, so it exits the Open event routine. The
only problem with this is that I get the macro security warning twice.

Alternatives enthusiastically entertained.

Thanks
tbone

__________ Information from ESET Smart Security, version of virus
signature database 4825 (20100201) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4825 (20100201) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
T

tbone

Rod,

Thanks for the suggestions, and I will remove this group from my
subscription list.

Thanks
tbone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top