Hi,
I have some code that determines if a directory has any files present as follows:
This works fine, but I am struggling to open files with a wildcard search:
There can be anywhere from o to 50 files in this folder, but the code is returning a 'file cant be found (runtime 1004 I think) error.
Can anyone help?
I have some code that determines if a directory has any files present as follows:
Code:
Function FileChk() As Boolean
' Determine if there are files to convert
strFile = Dir("c:\TNT\")
If strFile = "" Then
FileChk = False
MsgBox "No New Orders Found"
ElseIf strFile <> "" Then
FileChk = True
End If
End Function
This works fine, but I am struggling to open files with a wildcard search:
Code:
Workbooks.Open Filename:="C:\TNT\*.xlsx"
There can be anywhere from o to 50 files in this folder, but the code is returning a 'file cant be found (runtime 1004 I think) error.
Can anyone help?