View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_2_] Jake Marx[_2_] is offline
external usenet poster
 
Posts: 23
Default Prompt user to save their file

Hi Sharon,

You're correct - GetSaveAsFilename will only return the filename, if any,
the user selected; it won't actually save the file. So you have to do that:

Dim vPath As Variant

vPath = Application.GetSaveAsFilename(FileFilter:= _
"Microsoft Excel Files (*.xls), *.xls")

If vPath < False Then
ActiveWorkbook.SaveAs vPath
End If

--
Regards,

Jake Marx
MS MVP - Excel

Sharon wrote:
I am trying to prompt the user to save their file.

Application.GetSaveAsFilename looks like the right window
that pops up but the file doesn't actually save.

I tried this: ActiveWorkbook.SaveAs(Filename:=fName)
thinking I could set up a variable but maybe I have the
syntax wrong because it is not working.

Any ideas?
Thanks,
Sharon