Backup works for some users, not for others...

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?

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
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
.
.

Could it be that the N:\ drive is mapped with a different letter on different users's PCs?

Try substituting the "N:\" part of the path with the absolute network path, for example:

Code:
\\server\sharename\_BA21.N\CFO Monthly Status\FY2015\CFO Monthly Status\backup\
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top