Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Forcing Save As: dialog box

I have tried "application.ActiveWorkbook.SaveAs" to force the user to rename
and save the file upon completion of the macro. However, this command simply
saves the file to the default location with the same name as it when opened.
What am I missing?

Specifically, I want this command to be the last statement in the module
that will open the File Save As... dialog box, allow the user to select the
location and name the file, perform the Save and end the macro, returning
control to the user.

This macro will be universal, as the original file name will vary each time,
as will the Save As name.

Thanks for any input on this.

Bruce
swatsp0p
--
The older I get, the better I used to be.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Forcing Save As: dialog box

Dim fName as Boolean
fname = Application.GetSaveAsfileName()
if fName < False then
ActiveWorkbook.SaveAs filename:=fName
Else
msgbox "You hit cancel"
End if

See Excel vba help on GetSaveAsFileName for some argument options.

--
Regards,
Tom Ogilvy


"swatsp0p" wrote in message
...
I have tried "application.ActiveWorkbook.SaveAs" to force the user to

rename
and save the file upon completion of the macro. However, this command

simply
saves the file to the default location with the same name as it when

opened.
What am I missing?

Specifically, I want this command to be the last statement in the module
that will open the File Save As... dialog box, allow the user to select

the
location and name the file, perform the Save and end the macro, returning
control to the user.

This macro will be universal, as the original file name will vary each

time,
as will the Save As name.

Thanks for any input on this.

Bruce
swatsp0p
--
The older I get, the better I used to be.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Forcing Save As: dialog box

Thanks, Tom. Much more to it than just "Save As..." !! I looked in Help,
but didn't try "GetSaveAs...."... oh well.

Thanks again for your quick response. (I'll be a hero here for finishing
this project)

swatsp0p

"Tom Ogilvy" wrote:

Dim fName as Boolean
fname = Application.GetSaveAsfileName()
if fName < False then
ActiveWorkbook.SaveAs filename:=fName
Else
msgbox "You hit cancel"
End if

See Excel vba help on GetSaveAsFileName for some argument options.

--
Regards,
Tom Ogilvy


"swatsp0p" wrote in message
...
I have tried "application.ActiveWorkbook.SaveAs" to force the user to

rename
and save the file upon completion of the macro. However, this command

simply
saves the file to the default location with the same name as it when

opened.
What am I missing?

Specifically, I want this command to be the last statement in the module
that will open the File Save As... dialog box, allow the user to select

the
location and name the file, perform the Save and end the macro, returning
control to the user.

This macro will be universal, as the original file name will vary each

time,
as will the Save As name.

Thanks for any input on this.

Bruce
swatsp0p
--
The older I get, the better I used to be.




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
Forcing Save as in the format of Excel 2007 JJ[_3_] Excel Discussion (Misc queries) 1 June 1st 08 01:04 PM
Save as dialog David T Excel Discussion (Misc queries) 7 September 28th 07 05:12 PM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
Changing Save As Type in Save as dialog box Phill Excel Programming 2 August 22nd 03 12:38 PM
Save As Dialog Bob Phillips[_5_] Excel Programming 0 July 8th 03 11:09 PM


All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"