litestream
Active Member
- Joined
- Jul 24, 2006
- Messages
- 323
I want to save a copy of a document to my intranet but have a different vba code when the document is closed
I currently have:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim response As String
response = MsgBox("Do you want to save your changes to the Blue Book?", vbYesNo)
Application.EnableEvents = False
If response = vbNo Then ThisWorkbook.Close SaveChanges:=False
If response = vbYes Then ThisWorkbook.Save
If response = vbYes Then ThisWorkbook.SaveCopyAs "\\store\sites\sprintranet\paper\Blue Book\Blue Book.xls"
If response = vbYes Then ThisWorkbook.Close
Application.EnableEvents = True
End Sub
But I want to have the following on the copy:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.EnableEvents = False
ThisWorkbook.Close SaveChanges:=False
Application.EnableEvents = True
End Sub
Is this possible?
I currently have:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim response As String
response = MsgBox("Do you want to save your changes to the Blue Book?", vbYesNo)
Application.EnableEvents = False
If response = vbNo Then ThisWorkbook.Close SaveChanges:=False
If response = vbYes Then ThisWorkbook.Save
If response = vbYes Then ThisWorkbook.SaveCopyAs "\\store\sites\sprintranet\paper\Blue Book\Blue Book.xls"
If response = vbYes Then ThisWorkbook.Close
Application.EnableEvents = True
End Sub
But I want to have the following on the copy:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.EnableEvents = False
ThisWorkbook.Close SaveChanges:=False
Application.EnableEvents = True
End Sub
Is this possible?