I want to have the save as dialog open up with the filename populated with a filename built from the contents of several cells, and a default path. Should I put this in the beforesave event? or the beforeclose event? This is the code that I was trying to use, and not having the best results.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ThisFile As String
ThisFile = Worksheets("Pricing Sheet").Range("K10").Value _
& " " & Worksheets("Pricing Sheet").Range("K11").Value & " " _
& Worksheets("Pricing Sheet").Range("K12").Value & " " & "estwksht" & ".xls"
Application.Dialogs(xlDialogSaveAs).Show
Application.DefaultFilePath = "T:\Quot"
fileSaveName = Application.GetSaveAsFilename(ThisFile, filefilter:="Excel Files (*.xls), *.xls")
Application.ActiveWorkbook.SaveAs Filename:=fileSaveName
End Sub