Automatic saving

B

Berend Botje

Hi,

I am trying to make a "save as" application that does not require th
user to confirm the save. This means the script generates th
directory- and filename and automatically saves the workbook there.

Is this possible?

Yours truly,

Berend Botj
 
G

Gord Dibben

Berend

Possible, yes.

Sounds easy when you say it quickly, but you have a few variables in
there.......

When would you like to trigger the "save as"?

From what variables would the folder and filename be generated?

Here is some code that can be used to save the file and a backup copy using
the original name when you close the file.

Maybe adapt to suit or post back with more info.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="E:\GordStuff\Backup\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Gord Dibben Excel MVP
 
Top