View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Hans Petter Hans Petter is offline
external usenet poster
 
Posts: 3
Default Prompt user for a filename

Use the GetSaveAsFilename method.
From Excel Helpfile:
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Text Files (*.txt), *.txt")
If fileSaveName < False Then
MsgBox "Save as " & fileSaveName
End If

Then you can use the SaveAs method to save the fileSaveName

Hans Petter


"J S" skrev i melding ...
I want to create an excel macro that display the saveas dialog box to the
user, how do I do that?

i.e. I want the user to save the current document, but when I use
thisworkbook.save or thisworkbook.saveas excel does NOT display the saveas
dialog box where the user can select the filename and directory he wants

to
save to.

-J