Thread: Save As
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Save As

Dave, I believe that when you call the SaveAs dialog box with VBA that it
only allows you to return a path and filename. It doesn't do anything with
it. So, you need to add a line of code that executes after you click OK save
the ActiveWorkbook.

"Dave" wrote:

Hi,
XL2003
I am trying to do a SaveAs according to inputs entered by the op.
Two questions are asked, answers are Ans1 and Ans2
If I use: ActiveWorkbook.SaveAs Filename:=Ans1 & " " & Ans2
Then the workbook is saved correctly, but to the default location. I want
the op to be able to choose the location, but for the constructed filename to
be already present in the SaveAs dialogue box.
I tried: Application.GetSaveAsFilename (Ans1 & " " & Ans2)
which looked promising, allowing me to select the destination. But after
clicking Save, although the SaveAs dialogue box closed and the macro resumed,
the workbook was not actually saved.
Is there a syntax that will do what I want?
Thanks in advance.
Regards - Dave.