I'm trying to delete a file in a network location. Sometimes the file is there, sometimes it's not, so I'm using the following code:
Occasionally, I get a runtime 52 error when the file doesn't exist. I don't understand why I'm getting this when, if the file doesn't exist, the Dir function should return "".
I searched the forums for Runtime 52, and didn't find anything pertaining to this.
Thanks in advance for any help.
Will
Code:
strPath = "\\network drive\My Folder\"
strFilename = "MyFile.doc"
If Not Dir(strPath & strFilename) = "" Then Kill strPath & strFilename
Occasionally, I get a runtime 52 error when the file doesn't exist. I don't understand why I'm getting this when, if the file doesn't exist, the Dir function should return "".
I searched the forums for Runtime 52, and didn't find anything pertaining to this.
Thanks in advance for any help.
Will
Last edited: