Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xlDialogSaveAs

2 views
Skip to first unread message

Bmunny

unread,
May 12, 2003, 1:04:06 PM5/12/03
to
Hi Everyone

I was just wondering if you can specify the file name to
save as for this dialog and have the user select the path
in which to save it. I don't want the generic
filename "Book1.xls" to come up.

Is it possible with this dialog or is there another method
I could try.

Thanks,
Bmunny

Dave Peterson

unread,
May 12, 2003, 11:41:05 PM5/12/03
to
How about:

Application.Dialogs(xlDialogSaveAs).Show "C:\myfile.xls"

But you may want to look at Application.getsaveasfilename in help.

Option Explicit
Sub testme04()

Dim myFileName As Variant
myFileName = Application.GetSaveAsFilename _
(InitialFileName:="c:\myfile.xls")

If myFileName = False Then
'user hit cancel
Else
ActiveWorkbook.SaveAs Filename:=myFileName, FileFormat:=xlNormal
End If

End Sub

You can have more control over the stuff the macro does.

--

Dave Peterson
ec3...@msn.com

0 new messages