#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Save As

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Save As

To clarify:

fName = Application.GetSaveAs Filename:=Ans1 & " " & Ans2
fName.Save

"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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Save As

Hi JLG,
Yes, that did it. Thanks.
Regards - Dave.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
prompt user to save file as {desired_name} and save it to a variab GeneWan Excel Programming 1 January 5th 07 06:46 AM
Disable save, save as, but allow save via command button TimN Excel Programming 10 September 1st 06 07:05 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM


All times are GMT +1. The time now is 09:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"