SaveAs and Replace File

M

Milly

Hi
I have to save an excel file, I'm using the saveas method in a vb6 application, and in the case of the file already esists, a message box appears..
I can Avoid this message box and save the file? or...I can get the value of the answer to this message box to manage the code

Thanks!
Milly
 
T

Tom Ogilvy

fName = "C:\Myfolders\Myfile.xls"
if dir(fName) <> "" then
' file exists, what do you want to do
Else
' file doesn't exist, what do you want to do
End if

--
Regards,
Tom Ogilvy

Milly said:
Hi!
I have to save an excel file, I'm using the saveas method in a vb6
application, and in the case of the file already esists, a message box
appears...
I can Avoid this message box and save the file? or...I can get the value
of the answer to this message box to manage the code?
 
Top