VBA to call file based on date

F

fLiPMoD£

Hello,

I wonder if anyone can help me with a VBA routine to check for the presence
of a specific file.
The file is saved on a dialy basis in the format "userfile_run_YYYYMMDD.xls"

i am seeking help with a vb code that will check if today or any specified
days report is generated. i guess excel can use the date format to read the
specified location for the file.

Thank you in advance for your help.


.....Coming from Where I'm from.
 
B

Bob Phillips

Dim sFile As String

sFile = Dir("C:myPath\userfile_run_" & Format(Date,"yyyymmdd") & ".xls")
If sFile <> "" Then
Msgbx "File Exists
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
F

fLiPMoD£

Perfect...you are a star.

Thanks.

Bob Phillips said:
Dim sFile As String

sFile = Dir("C:myPath\userfile_run_" & Format(Date,"yyyymmdd") & ".xls")
If sFile <> "" Then
Msgbx "File Exists
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top