VBA - Define Dir Path and Save As

Post date: Sep 30, 2010 2:13:09 PM

Path = ActiveWorkbook.Path

ChDrive Path

fname = Application.GetSaveAsFilename _

(InitialFileName:=Range("example"), _

fileFilter:="Excel Files (*.XLS), *.XLS", _

Title:="Save As")

If fname = False Then

MsgBox "User pressed cancel, the file will be not saved!"

ActiveWorkbook.Close False

Else

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:=fname

Application.DisplayAlerts = True

ActiveWorkbook.Close False

MsgBox "Saving as " & fname, vbInformation

end if