Getting the save prompt

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
 
J

JW

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top