Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Using SaveAs Dialog and Changing Location

I would like to call up the Save As dialog box, but get it to save in a
specific folder, as opposed to the current workbook's path. Eg. Instead of
the workbook's path of "C:\Test\Test.xls", I would like it to look in
"C:\Test2" and let you choose a filename.

TIA.
--
I am running on Office 2003, unless otherwise stated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Using SaveAs Dialog and Changing Location


Hi Orion

Change MyPath

Sub test()
Dim FName As Variant
Dim MyPath As String
Dim SaveDriveDir As String

SaveDriveDir = CurDir

MyPath = "C:\Users\Ron\Test2\"
ChDrive MyPath
ChDir MyPath

FName = Application.GetSaveAsFilename("", _
fileFilter:="Excel Files (*.xls), *.xls")
If FName < False Then
' do your Save stuff
End If

ChDrive SaveDriveDir
ChDir SaveDriveDir

End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Orion Cochrane" wrote in message
...
I would like to call up the Save As dialog box, but get it to save in a
specific folder, as opposed to the current workbook's path. Eg. Instead of
the workbook's path of "C:\Test\Test.xls", I would like it to look in
"C:\Test2" and let you choose a filename.

TIA.
--
I am running on Office 2003, unless otherwise stated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Using SaveAs Dialog and Changing Location

I wonder if Ron's answer is what the OP really wanted or if the Save as
dialog box was required. The following actually displays the Save As dialog
box with the required folder location.

Sub SaveWorkbook()

Dim myTitle

'myTitle is the title displayed on the dialog box.
myTitle = "Select or enter the file name for save"

With Application.FileDialog(msoFileDialogSaveAs)
.Title = myTitle

'Note the backslash on the end or Excel _
interprets last text as a file name.
.InitialFileName = "C:\Users\OssieMac\Documents\Excel\"

.Show
End With

--
Regards,

OssieMac


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
SaveAs dialog box Ronio Excel Programming 1 February 15th 08 07:00 PM
SaveAs Dialog comes up twice??? chemicals Excel Programming 3 February 23rd 07 08:10 PM
SaveAs Dialog Box Noemi Excel Programming 1 November 8th 06 09:15 AM
SaveAs dialog Gary''s Student Excel Discussion (Misc queries) 2 February 23rd 06 03:11 PM
Saveas Dialog Box Tom Ogilvy Excel Programming 0 September 15th 04 04:57 PM


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