Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,533
- Office Version
- 365
- 2016
- Platform
- Windows
I am using this code below to check to see if a file exists in a directory as specified by a user.
I am getting an error ("Object Required.") from the line highlighted in red.
As always, any help would be welcomed.
Rich (BB code):
Sub find_file()
Dim sFile1 As String
If Target.Address <> "$E$16" Then Exit Sub
sFile1 = "E:\SportsOps 2009\SportsOps 2009\Data\" & Format(Target, "d-mmm-yy") & ".xls"
If Dir(sFile1) = "" Then
MsgBox "Error"
Exit Sub
End If
MsgBox "OK."
End Sub
I am getting an error ("Object Required.") from the line highlighted in red.
As always, any help would be welcomed.