Hi,
The problem:- vba to check the presence of a file then prompt user if file
is to be opened or not.
For some reason, when i click no, the program still open the file.
Your help will be very much appreciated.
Sub PegaToday()
Dim sFile As String
sFile = Dir("O:\MRS_reports\Setts\pega_outstanding_" & Format(Date,
"yyyymmdd") & ".xls")
If sFile <> "" Then
MsgBox "Todays Pege is Ready" & vbCrLf & "" & vbCrLf _
& "Do You want to Open?", vbYesNo, "Ready or Not"
If vbYes Then
Workbooks.Open sFile
ElseIf vbNo Then Exit Sub
End If
End If
End Sub
....Comin' From Where I'm From
Bookmarks