You can check if the file is open by some other user with this approach:
http://support.microsoft.com?kbid=138621
XL: Macro Code to Check Whether a File Is Already Open
http://support.microsoft.com?kbid=291295
XL2002: Macro Code to Check Whether a File Is Already Open
http://support.microsoft.com?kbid=213383
XL2000: Macro Code to Check Whether a File Is Already Open
http://support.microsoft.com?kbid=184982
WD97: VBA Function to Check If File or Document Is Open
The articles are all basically the same.
If you find the file is open, then don't offer to archive it.
--
Regards,
Tom Ogilvy
"CLR" wrote:
Hi All....
I have the following macro in a program to prompt the users to occasionally
Archive the file. It works fine, however, when someone opens the file, if
another user already has it open, I would like the pop-up not to appear. How
might the below code be modified to accomplish that, please?
Private Sub Workbook_Open()
Dim MyDate
MyDate = Date
Dim LastDate
LastDate = Range("ah37").Value
ans = MsgBox("This LOGBOOK Program has not been Archived since " &
LastDate & ".....Do it now?", vbYesNo)
If ans = vbYes Then
Range("ah37").Select
Selection.Value = MyDate
Application.Run "NewSaveArchive"
Else
End If
End Sub
Thanks,
Vaya con Dios,
Chuck, CABGx3