1.11M Members

runtime error#58

 
0
 

Do you know what this is and how to fix?

 
0
 

It also says program already exists.

 
0
 

Exactly what are you trying to do?

 
0
 

Error 58 is File already exists.

(you can do ERROR #)
where # is a number to find out the error message for that error number

Without the code, it will be impossible to debug.

(You can also get a list of run-time errors and the associated error messages
in the help). F1 then I then E then Error Statement then Run-Time error Codes

 
0
 

open up the tech in a box.
win xp home

 
0
 

it says to check for updates when I click yes I get the error 58 file already exists when I click ok to the error it cancels the program

 
0
 

Do you know what this is and how to fix?

PLZ TELL ME ABOUT RUN TIME ERROR 58 AND HOW CAN I FIX IT

 
0
 

plz tell to fix run time error 58

 
0
 

can you post your code please, where the error takes place...thanks.

 
0
 

Yes, Post Your code, so that we may see, and tinker with it.

 
0
 

Runtime error 58 occurs when you try to rename a file with a name that already exists (in the same folder), or you try to save a new file with the same name as one that already exists (in the same folder).

With MSDOS, sorry Windows you cannot insert information into a file that already exists. The way around this is to first re-name the old file (so it is still there if you need it, a temporary file so to speak) with an obscure name (I use a few relevant "ABC" characters) plus a randomly generated number) for new name of the "old" file. Then I use a string to store the new name of the file (so I can still refer to it). Then you save the new information to the old file name (now you have re-named it, it won't clash). At this point if it goes wrong you can then re-name the "backup" file and you will be where you were before. If there is no problem and the new file is saved then you just delete the temporary file. If you don't then the folder will become full of the temporary files.

This sounds confusing. I think Comatose will understand what I mean. I hope you do as well.

 
0
 

That was a trick I used to use in Batch file fun.... :)

 
0
 

If you are just trying to create a new file and want to delete the old file. use kill before your open statement.

kill app.path & "\file.txt"

But like mrConfused stated, i would rename the file first. You might try nameing each file with the date and time, something like this usually does not get overwritten because the file name is always different, unless someone has reset the system clock or your writing more than one file per second.

Open App.Path & "\" & Year(Date) & Month(Date) & Day(Date) & Hour(Time) & Minute(Time) & Second(Time) & ".txt" For Output As #1
 
0
 

I always find shelling to be a convient way to execute simple operations.... certainly you could always use a rename function or an API call, but it's just as easy to shell with the rename command.

 
0
 

Runtime Error 58

 
0
 

Runtime Error 58

Is that a question?

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article