Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

BeforeSave

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven - 21 Jan 2006 17:09 GMT
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
Damon Longworth - 21 Jan 2006 17:13 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.