I am using the following code to check to see if a text file exists.
is a subroutine I wrote that logs a message to a log file.
The code jumps into the If statement to indicate that the file does not exist, although if I open up the log file or look at the message box, I could manually open up the file, whose full path is stored in the variable
and I can also do DIR command from a command prompt on that file. Why does the
think the file does not exist??
The file was created from
using the
command with a create=True from another script and that file was also closed first.
Code:
Log
The code jumps into the If statement to indicate that the file does not exist, although if I open up the log file or look at the message box, I could manually open up the file, whose full path is stored in the variable
Code:
strInfoFilePath
Code:
FileSystemObject
The file was created from
Code:
FileSystemObject
Code:
OpenTextFile
Code:
Dim objFileSystemObject, strInfoFilePath
strInfoFilePath = PACKAGEFILE_DIR & "\" & INFO_FILE
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
'First check to see if the INFO_FILE exists
If Not objFileSystemObject.FileExists(strInfoFilePath) Then
Call Log(strInfoFilePath & " not found.")
Call MsgBox(strInfoFilePath & " not found.")
End If