Option Explicit
Private Sub Workbook_Open()
Dim RunOnceFile$
RunOnceFile = "C:\" & "RUN THIS ONCE.Log"
If Dir(RunOnceFile) = Empty Then
Open RunOnceFile For Output As #1
Close #1
Else
Exit Sub
End If
End Sub
Option Explicit
Private Sub Workbook_Open()
Dim RunOnceFile$, User$, Msg As VbMsgBoxResult
User = Application.UserName
RunOnceFile = "C:\" & "DONT SHOW AGAIN.Log"
If Dir(RunOnceFile) = Empty Then
Msg = MsgBox(" Welcome " & User & _
" The time is now " & Format(Now, _
"hh:mm AMPM") & vbLf & _
"" & vbLf & _
"The instructions for using this file are as follows:" & vbLf & _
"Blah, blah, blah, and" & vbLf & _
"blah, blah, blah" & vbLf & _
"" & vbLf & _
"Do you want this message shown each time you" & vbLf & _
"open this file ?", _
vbYesNo, "Hi " & User)
If Msg = vbNo Then
Open RunOnceFile For Output As #1
Close #1
Exit Sub
End If
Else
Exit Sub
End If
End Sub
|