LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Use Workbook BeforeSave Event to Save Copy to Different Location

I have a workbook that I would like to save a copy to a different location
everytime I save the workbook. I use the BeforeSave Event. The copy saves
perfectly but it doesn't save to its original folder, why?

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim strPrompt As String
Dim intButtons As Integer
Dim strTitle As String

On Error Resume Next
With ThisWorkbook

' save a copy in public folder in power vault
.SaveCopyAs ("\\Powervault\Global Schedule BU\" & ThisWorkbook.Name)

' if error occurs notify user
If Err.Number 0 Then
strPrompt = "The back up file for " & ThisWorkbook.Name & "
was not saved in '\\Powervault\Global Schedule BU' folder."
strPrompt = strPrompt & " Please make a note of this and
notify Ryan."
intButtons = vbExclamation
strTitle = "Problem"
MsgBox strPrompt, intButtons, strTitle
End If
End With

End Sub
--
Cheers,
Ryan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beforesave - Save copy on my desktop J.W. Aldridge Excel Programming 3 September 26th 07 11:40 PM
Protect Worksheet / Workbook in BeforeSave Event tc69 Excel Programming 2 April 23rd 07 11:00 AM
Save method and BeforeSave event [email protected] Excel Programming 1 July 15th 05 04:58 AM
BeforeSave sub won't save another workbook when triggered by another event sub Brad Yundt Excel Programming 1 June 3rd 04 03:12 AM
BeforeSave workbook event Cindy Excel Programming 15 February 10th 04 04:28 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"