Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using a macro to save a file.

I need to find out how to write a macro that brings up the save as dialog
box, lets the user enter in where to save the document as well as the name of
the document, then after it's saved continue with the rest of the macro.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Using a macro to save a file.

Hi
in the VBA help have a look at:
application.GetSaveAsFilename

--
Regards
Frank Kabel
Frankfurt, Germany

"Menoh" schrieb im Newsbeitrag
...
I need to find out how to write a macro that brings up the save as

dialog
box, lets the user enter in where to save the document as well as the

name of
the document, then after it's saved continue with the rest of the

macro.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using a macro to save a file.

Dim fName as String

' code before the save

fname = Application.GetSaveAsFilename()
if fName < "False" then
activeworkbook.SaveAs fName
End if

' code after the save


fName will equal "False" if the user hits cancel - not sure what you want to
do in that case. Note that the save doesn't occur just by using the
dialog. The actuall save is done with Activeworkbook.SaveAs.

Also, if you want to silently overwrite an existing file with the selected
name

Application.Displayalerts = False
activeworkbook.SaveAs fName
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy

"Menoh" wrote in message
...
I need to find out how to write a macro that brings up the save as dialog
box, lets the user enter in where to save the document as well as the name

of
the document, then after it's saved continue with the rest of the macro.



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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
Macro to save a file as a PDF ynissel Excel Discussion (Misc queries) 8 May 25th 05 10:46 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 10:55 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"