I want to check to see if a file exists and if it does, I want to open it and read the 1st line,
If the file doesn't exist or if the file has no contents then I want to fail silently without letting anyone know that an error occurred.
Start with this:
Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists(path)) Then msg = path & " exists." Else msg = path & " doesn't exist." End If
Taken from the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With