Already error58 exist file runtime


















My application has been running fine until recently when the user has got an error message when he tries to run the app. The error message is 'File alredy exists runtime error 58' I have uninstalled the app and deleted all folders and shortcuts associated with the app. I have reinstalled the app but I am still getting the same error.

Has anyone got any ideas Thanks JL. Join our community to see this answer! Unlock 1 Answer and 2 Comments. Andrew Hancock - VMware vExpert. Fields "GiftDescription". Range "H14". Range "I15". Range "H15". Fields "OtherInfo". Range "H16". Fields "FileName". Update End With rst. Name MyWorkbook. Enlico Before you do the "moveFile", check to see if the file already exists at your destination location.

If it does, then try to delete it and if the delete is successful, then do the move, if not, then you have a locked file and you need to handle that situation. Hi there, i have a vba code that works fine, but i got a error 58 when the file exists with the same name.

ElseIf InStr objFile. Name, ". Thanks in advance for your help. Hi , Can you post the complete code? Hi , If you just wish to ignore the errors , then see if this works : Code:. GetFolder mydir. Otherwise, destination is assumed to be the name of a destination file to create As the help states, if the separator is absent, then the system tries to create the destination.

Thus, the error occurs because you are trying to recreate a folder that already exists. What should be done?

Personally, I think you should test for the existence of the destination folder prior to. MoveFile via. FolderExists AND test for the existence of the source file in destination prior to.

Testing these two scenarios will at least this care of two of the situations that will inevitably occur. I put some code below for you to reference. Best, Matt. FileExists Source Then 'move the file.



0コメント

  • 1000 / 1000