Automatic saving as different filename

D

Dave Rey

Is there any way of writing simple code which will either
save an Excel file as a new, slightly different filename,
or at least prompt the user to do so.

For example, if I have a file called:

c:\work\2004\July accounts - linked.xls

I have a macro within this file to perform some actions on
the data (eg refresh it).

I then want to add to the end of the macro, the code to
save the file as a new filename such as:

c:\work\2004\July accounts - amended.xls

In doing this I obviously want to keep the path and
directories as general as possible and not referred to by
name, in case I want to move the files later on.

Thanks

Dave
 
K

Kathy

Sure,
But it would be much easier just to remind the user with
a prompt to do a save as. Unless you want to keep
numbering, your files?
To prompt the user create a message box in the Workbook
BeforeClose in the Visual Basic Editor Window.

Public Sub SaveFile()
Dim SaveFile As String
strSaveFile = MsgBox _
("Please do a Save As?")
End Sub

Good Luck
 

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