zimmer9
asked on
How to handle the message: Run time error '58 "File already exists" when renaming a file to an existing file name ?
I am developing an Access application with Access VBA.
How to handle the message: Run time error '58 "File already exists" when renaming a file to an existing file name. Is there a way to send a MsgBox with this error instead of the Microsoft Visual Basis run time error being generated ?
For ex:
sfile = "\\nydfs1\root\lib\CONTROL LERS\IIG\C ASH_CONTRO L\ccshared \Abandoned Property\U DL\Access\ UDLLexisNe xis\Morgan _Stanley_U DL_LN_prc" & ".xls"
If isFileExist(sfile) Then
Name sfile As Left(sfile, Len(sfile) - 4) & "_" & Format(Date, "yymmdd") & ".xls"
End If
How to handle the message: Run time error '58 "File already exists" when renaming a file to an existing file name. Is there a way to send a MsgBox with this error instead of the Microsoft Visual Basis run time error being generated ?
For ex:
sfile = "\\nydfs1\root\lib\CONTROL
If isFileExist(sfile) Then
Name sfile As Left(sfile, Len(sfile) - 4) & "_" & Format(Date, "yymmdd") & ".xls"
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.