View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Getting the save prompt

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

Sonnich Jensen wrote:
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