Thanks for your reply.
here's my code.
ActiveWorkbook.SaveAs Filename:=myfilename
MsgBox ("File Saved.")
The above code works fine if the "myfilename" doent exists. When the filename already exists, a display allerts message pops up that says"filename exists. Do you want to replace it? if user clicks OK, the code works fine as is. But when the button NO or CANCEL is clicked, the program displays error message,,, end or debug..... I want to terminate the code when NO or CANCEL is selected, how is it done? thanks