SaveAs Method Example

This example creates a new workbook, prompts the user for a file name, and then saves the workbook.

Set NewBook = Workbooks.Add
Do
    fName = Application.GetSaveAsFilename
Loop Until fName <> False
NewBook.SaveAs Filename:=fName