I have a file that is used by another person in their directory. When they
save the file I do various tests on values of certain range named cells and
if all the values are ok then that means the file is basically in good order
and I want a copy. The issue is they sometimes mess up a file and don't
realize it until they have mess it up even more, but it I can get a copy
when all test conditions are ok then I will always have the last good copy
handy. I was hoping to do somethin like this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If (Here are various tests and if OK) Then
ActiveWorkbook.SaveAs Filename:="F:\Shared\Systems\Book3.xls",
FileFormat:= xlNormal, Password:="mybackup"
Endif
End Sub
And then it would go ahead and save their file in their directory.
Note: I would alwasy like their file saved and only save to my directory if
all the tests are ok. I have tried the above but excel errors totally out
where you get the message. Do you want to send a report to Microsoft?
Is there a way to do what I want?
Thank you for your help.
Steven
Have a look at the SaveCopyAs Method in help.

Signature
Damon Longworth
2006 East Coast Excel User Conference
April 19/21st, 2006
Holiday Inn, Boardwalk
Atlantic City, New Jersey
Early Bird Registration Now Open!!
www.ExcelUserConference.com
2006 UK Excel User Conference
Summer, 2006
London, England
I have a file that is used by another person in their directory. When they
save the file I do various tests on values of certain range named cells and
if all the values are ok then that means the file is basically in good order
and I want a copy. The issue is they sometimes mess up a file and don't
realize it until they have mess it up even more, but it I can get a copy
when all test conditions are ok then I will always have the last good copy
handy. I was hoping to do somethin like this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If (Here are various tests and if OK) Then
ActiveWorkbook.SaveAs Filename:="F:\Shared\Systems\Book3.xls",
FileFormat:= xlNormal, Password:="mybackup"
Endif
End Sub
And then it would go ahead and save their file in their directory.
Note: I would alwasy like their file saved and only save to my directory if
all the tests are ok. I have tried the above but excel errors totally out
where you get the message. Do you want to send a report to Microsoft?
Is there a way to do what I want?
Thank you for your help.
Steven
Steven - 21 Jan 2006 17:37 GMT
And its good.
Thank you very much.
> Have a look at the SaveCopyAs Method in help.
>
[quoted text clipped - 26 lines]
>
> Steven