Getting the save prompt

  • Thread starter Thread starter Sonnich Jensen
  • Start date Start date
S

Sonnich Jensen

Browsing this group, I found that I have an odd problem - I would like
to get the save prompt, but I dont.

I have tried using stuff like activeworkbook.save

' save the document
NewWkBk.Save

My problem: I want to prompt the user for a filename, so it can be
saved... but that does never happen, the code above just gives me a
file like book8.xls in the default dir

How do I pop the save dialog?

WBR
Sonnich
 
Sub example()
Dim fName As Variant
Dim NewWkBk As Workbook
'change as needed
Set NewWkBk = ActiveWorkbook
fName = Application.GetSaveAsFilename _
(filefilter:="Excel Files (*.xls),*.xls")
If fName = False Then Exit Sub
NewWkBk.SaveAs fName
End Sub
 
Back
Top