I transferred a Excel 2011 macro to Excel 2019 and the code is failing on the Dir() command.
I have code that appends the file name with the date. Then it checks to see if the newfile (NewPathFileExt) already exists.
If it does I prompt "Do you want to overwrite it" Y/N
If it doesn't I write the new file to that location.
The code FileThere = (Dir(NewPathFileExt) > "") gives the following if file NewPathFileExt exists. It runs ok if NewPathFileExt does not exist
I understand this has something to do with VBA is sandboxed in Excel 2019.
I've tried all sorts of commands with no success.
What code will tell me if the file exists without asking for permission??
I have code that appends the file name with the date. Then it checks to see if the newfile (NewPathFileExt) already exists.
If it does I prompt "Do you want to overwrite it" Y/N
If it doesn't I write the new file to that location.
The code FileThere = (Dir(NewPathFileExt) > "") gives the following if file NewPathFileExt exists. It runs ok if NewPathFileExt does not exist
I understand this has something to do with VBA is sandboxed in Excel 2019.
I've tried all sorts of commands with no success.
What code will tell me if the file exists without asking for permission??