mbrwny20
12-14-2008, 10:42 AM
Hello,
I'd like to insure that an authorized workbook on a network drive is the one being opened. Sometimes people will copy a workbook from the network to their desktop or their mydocuments folder, and now if I update information they will no longer have the current version.
This what I have tested today;
Sub Auto_Open()
If Application.StartupPath <> "c:\" & ThisWorkbook.Name & ".xls" Then
MsgBox ("you have opened this workbook in an invalid location.")
ThisWorkbook.Close
End If
End Sub
However, the startuppath is not what I desire. Should I be looking at workbook.fullname and then parse the path minus the workbook name to see if it has been opened from the desired directory.
Thank you
I'd like to insure that an authorized workbook on a network drive is the one being opened. Sometimes people will copy a workbook from the network to their desktop or their mydocuments folder, and now if I update information they will no longer have the current version.
This what I have tested today;
Sub Auto_Open()
If Application.StartupPath <> "c:\" & ThisWorkbook.Name & ".xls" Then
MsgBox ("you have opened this workbook in an invalid location.")
ThisWorkbook.Close
End If
End Sub
However, the startuppath is not what I desire. Should I be looking at workbook.fullname and then parse the path minus the workbook name to see if it has been opened from the desired directory.
Thank you