SchmittyT9
9 years agoNew Contributor
aqFile.Exists(filePath) is returning true, but aqFile.GetSize(filePath) returns an error
I have some code that first checks if the file exists, and then does some other stuff, including getting the file size.
If aqFile.Exists(filePath) Then fileSize = aqFile.GetSize(filePath) ' Do some other stuff End If
This works consistently on my Windows 10 tests, but fails every time on the second line on Windows 7 with this error message: "Unable to open the file."
I'm not sure what to do here, I thought the whole point of doing the If Then statement with aqFile.Exists was to avoid this kind of error?
Can anyone help me out?