khalid79m
09-24-2008, 03:59 AM
Private Sub M()
Environ$ ("username")
Dim sID As String
sID = LCase(Environ$("username"))
If sID = "046439" Then
Application.EnableEvents = False
Application.DisplayAlerts = False
Else
Application.EnableEvents = True
Application.DisplayAlerts = True
End If
End Sub
I currently use this code if i am logged on , it stops the enablevents and alerts if i have opend the document, if someone else opens it the enablevents & Display alerts is true.
I need this code to only work if the workbook "abc.xls" is open in the background rather than who opens it.
can anyone help
Environ$ ("username")
Dim sID As String
sID = LCase(Environ$("username"))
If sID = "046439" Then
Application.EnableEvents = False
Application.DisplayAlerts = False
Else
Application.EnableEvents = True
Application.DisplayAlerts = True
End If
End Sub
I currently use this code if i am logged on , it stops the enablevents and alerts if i have opend the document, if someone else opens it the enablevents & Display alerts is true.
I need this code to only work if the workbook "abc.xls" is open in the background rather than who opens it.
can anyone help