Change directory on Save As Dialog Box in Excel

3 views
Skip to first unread message

Rebecca Hannaman

unread,
Sep 25, 2001, 3:21:13 AM9/25/01
to
I have a .xlt file that multiple users need to "save as" to a drive other
then their default Excel directory. I found the following code in
Microsofts Knowledge base. The code brings up the dialog box, but I don't
know how to code to the directory I need it to open too. Does anybody have
any suggestions? I do not know what filename the users will be using.

Application.ExecuteExcel4Macro("SAVE.AS?()")


Thanks.

Becky


Harald Staff

unread,
Sep 25, 2001, 3:51:57 AM9/25/01
to
Hi Rebecca

Try this instead:

Sub SaveMe()
Dim Savepath As Variant
Savepath = Application.GetSaveAsFilename("C:\Code\A.xls", _
"Beckys Workbooks (*.xls), *.xls", , "Pick a nice place")
If Savepath = False Then Exit Sub 'cancelled!
ActiveWorkbook.SaveAs Savepath
End Sub

It starts in C:\Code. Change that to the directory of your choice.

Best wishes Harald

"Rebecca Hannaman" <rhan...@worldnet.att.net> wrote in message
news:JfWr7.7963$WW.7...@bgtnsc05-news.ops.worldnet.att.net...

Alascom

unread,
Sep 25, 2001, 3:08:02 PM9/25/01
to
Worked Great!, Thanks Harald!

"Harald Staff" <harald...@eunet.no> wrote in message
news:uAXlRbZRBHA.1892@tkmsftngp05...

Reply all
Reply to author
Forward
0 new messages