LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default How to make the "Save As" prompt appear with vba?


"Jake Marx" wrote in message
...
Hi Bura,

Just to expand a bit...as Frank shows, there is no way to specify the
starting drive/path for the dialog. So you must actually change the

current
directory for the user, then display the form. When you do that, it's a
good idea to put things back in place when you're done. Here's an

example:

Sub ShowSaveAs()
Dim vResponse As Variant
Dim sOldPath As String

sOldPath = CurDir

ChDrive "C:"
ChDir "C:\"

vResponse = Application.GetSaveAsFilename("jake.xls", _
"Microsoft Excel Files (*.xls), *.xls")

If vResponse < False Then
MsgBox CStr(vResponse)
End If

ChDrive sOldPath
ChDir sOldPath
End Sub

As Harald noted, this does not *do* anything per se. But it will return
either False (if the user clicked Cancel) or a String representing the

full
path/filename the user selected.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com



Thank you all -- so useful!!!


[please keep replies in the newsgroup - email address unmonitored]


Bura Tino wrote:
Hi,

Is there vba for making the Save As prompt appear with a certain
active directory and a suggested file name?

Thanks,

Bura






 
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
is it possible to disable "save" prompt in excel file on web server? [email protected] Excel Discussion (Misc queries) 0 May 9th 07 05:58 PM
Turning off "save changes" prompt TC Excel Discussion (Misc queries) 3 March 16th 06 09:08 PM
Disallow "SAVE" only "SAVE AS" or prompt DTTODGG Setting up and Configuration of Excel 6 December 21st 05 03:54 PM
"save changes" prompt missing Dennis Excel Discussion (Misc queries) 0 October 31st 05 04:32 AM
How can I get "File Close" to prompt me to "Save Changes" ?? Charles Jordan Excel Programming 4 July 31st 03 04:01 PM


All times are GMT +1. The time now is 12:12 AM.

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"