Give this a try.<pre>Sub SaveAs()
Do
getfilename = Application.GetSaveAsFilename _
(FileFilter:="Microsoft Excel WorkBook(*.xls),*.xls,Microsoft Excel Template(*.xlt),*xlt")
If getfilename = False Then
'MsgBox "Save As was cancelled, workbook was not saved.", vbOKOnly + vbExclamation, "Save As"
Exit Sub
End If
getfilename_exist = Dir(getfilename)
If getfilename_exist<> "" Then
Select Case MsgBox("The file [" & getfilename_exist & "] already exist in this location, do you want to replace the existing file?", vbYesNoCancel + vbExclamation, "Save As")
Case vbYes
Application.DisplayAlerts = False
Case vbNo
getfilename = ""
Case vbCancel
'MsgBox "Save As was cancelled, workbook was not saved.", vbOKOnly + vbExclamation, "Save As"
Exit Sub
End Select
End If
Loop Until getfilename<> ""
Application.EnableEvents = False 'comment this line to not by-pass Workbook_BeforeSave event
ThisWorkbook.SaveAs Filename:=getfilename, CreateBackup:=True
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub</pre>
_________________
Win 98SE - Office 2K
This message was edited by dsnbld on 2002-08-26 07:30