Hi Guys
Can any one help with this problem please.
Sample code:-
Sub SaveAsExample()
Dim FName As String
Dim FPath As String
FPath = "F:\quote"
FName = Sheets("quote").Range("f2").Text
ThisWorkbook.SaveAs FileName:=FPath & "\" & FName
Dim wb As Workbook
MsgBox "" & Range("f2").Value & " has been saved"
End Sub
This simple macro works the first time you save the file then the next time you save it you are presented with a "a file named **** already exists, do you want to replace it. yes/no/cancel.
The problem is that if you press either "no" or "cancel" rather than "yes", a VB 400 error comes up.
Question.
Can i put some additional code in that prevents this VB 400 error comming up.
Thanks in advance for any help.
Regards
Keith
Bookmarks