I want to create a file, but it may already exist. If it does, I get the message asking if I want to overlay the file. I do not want that message, rather I would like to just send a msgbox. My code is:
Sub test()
Dim tear As Range
Set tyear = Range("a1")
File_name = tyear & ".xls"
Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
File_name, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
On Error GoTo no_file
ActiveWorkbook.Close
GoTo endit
no_file:
MsgBox (File_name & " already exists.")
endit:
End Sub
Bookmarks