Mississippi Girl
Board Regular
- Joined
- Oct 27, 2005
- Messages
- 155
We have a workbook that is shared by a lot of people. It's saved on a network drive and users of the workbook go in and make updates as needed. We've been having problems with folks forgetting to save their work, so I included this bit of code to save a "back up" before the file is closed, regardless of what the user says about saving.
It works perfectly with some people, but others receive an error saying the file cannot be accessed. Any ideas why some can use it and others cannot?
It works perfectly with some people, but others receive an error saying the file cannot be accessed. Any ideas why some can use it and others cannot?
Code:
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim MyBackupPath As String
MyBackupPath = "N:\_BA21.N\CFO Monthly Status\FY2015\CFO Monthly Status\backup\"
ActiveWorkbook.SaveCopyAs MyBackupPath & Format(Now, "yy.mm.dd h mm a/p") & " " & Application.UserName & " " & ActiveWorkbook.Name
End Sub