abenitez77
Board Regular
- Joined
- Dec 30, 2004
- Messages
- 149
I am checking for file size on files before I process them. I am trying to get information on a text file which has double quotes as part of it's name. The path and filename is saved in a table. I get an error msg(error 53: file not found....) and I can't figure out how to get around it. Here is my code:
XLFileFullPath has this value below which I get from a table that has the list of file names:
\\Servername\auditfiles\DealSheet043019_EML_ZIP\4\4786-2306\18-070909 "NEW ITEM SETUP REQUEST" WM D1 Candy 2_met.txt
XLFileFullPath has this value below which I get from a table that has the list of file names:
\\Servername\auditfiles\DealSheet043019_EML_ZIP\4\4786-2306\18-070909 "NEW ITEM SETUP REQUEST" WM D1 Candy 2_met.txt
Code:
'code for FSO:
Set fso = CreateObject("Scripting.FileSystemObject")
FileExt = fso.GetExtensionName(XLFileFullPath)
Set fld = fso.GetFolder(fso.GetParentFolderName(XLFileFullPath))
Set sMyFile = fso.GetFile(XLFileFullPath)
FileSz = sMyFile.Size
If FileSz = 0 Then
ZeroLen = True
GoTo FileNotExists
End If