Discussion:
Setting the default file name in the XLDialogSaveAs dialog box
(too old to reply)
Nelson
2004-02-01 16:47:16 UTC
Permalink
I am writing a VB.Net program that dumps data to excel
2002. After I dump the data, I would like to have the
user chose where to save the file using the built in File
SaveAs dialog box. I can't make sense of the
argumentlist for this dialog. can anyone tell me how to
set the default file name?

Thanks!
Tom Ogilvy
2004-02-01 16:50:50 UTC
Permalink
Look at application.GetSaveAsFilename

the argument list is simpler. This returns the fully qualified name
selected - you then have to save the file with your code.

--
Regards,
Tom Ogilvy
Post by Nelson
I am writing a VB.Net program that dumps data to excel
2002. After I dump the data, I would like to have the
user chose where to save the file using the built in File
SaveAs dialog box. I can't make sense of the
argumentlist for this dialog. can anyone tell me how to
set the default file name?
Thanks!
Dave Peterson
2004-02-01 16:50:50 UTC
Permalink
Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my documents\test.xls"

is one way.
Post by Nelson
I am writing a VB.Net program that dumps data to excel
2002. After I dump the data, I would like to have the
user chose where to save the file using the built in File
SaveAs dialog box. I can't make sense of the
argumentlist for this dialog. can anyone tell me how to
set the default file name?
Thanks!
--
Dave Peterson
***@msn.com
Nelson
2004-02-03 19:05:47 UTC
Permalink
-----Original Message-----
Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my
documents\test.xls"
is one way.
Post by Nelson
I am writing a VB.Net program that dumps data to excel
2002. After I dump the data, I would like to have the
user chose where to save the file using the built in
File
Post by Nelson
SaveAs dialog box. I can't make sense of the
argumentlist for this dialog. can anyone tell me how
to
Post by Nelson
set the default file name?
Thanks!
--
Dave Peterson
.
Thanks Dave! I tried the following VB.NEt equivalent
statement, but it didn't work:

Result = EXL.Dialogs
(Excel.XlBuiltInDialog.xlDialogSaveAs).Show Argl:= fName

The Argl:= fName protion generated a syntax error
message - "End of statement expected".

there must be a difference in how this works from
VB.NEt. any suggestions?
Dave Peterson
2004-02-04 02:29:35 UTC
Permalink
No idea at all how .net works.

But xldialogsaveas has a constant value of 5.

So maybe (grasping way beyond my reach):
Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my documents\test.xls"
could be something like:

Application.Dialogs(5).Show("C:\my documents\test.xls")
or
Result = EXL.Dialogs(5).Show(fName)

If .net is like VBA, then you'll need to surround the fName with parentheses,
too.

In fact, that might be the only thing you need to fix!

(xldialogsaveas would be available for use if you had a reference to Microsoft
Excel in your program. If you use createobject() to start excel, then use 5.)
Post by Dave Peterson
-----Original Message-----
Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my
documents\test.xls"
is one way.
Post by Nelson
I am writing a VB.Net program that dumps data to excel
2002. After I dump the data, I would like to have the
user chose where to save the file using the built in
File
Post by Nelson
SaveAs dialog box. I can't make sense of the
argumentlist for this dialog. can anyone tell me how
to
Post by Nelson
set the default file name?
Thanks!
--
Dave Peterson
.
Thanks Dave! I tried the following VB.NEt equivalent
Result = EXL.Dialogs
(Excel.XlBuiltInDialog.xlDialogSaveAs).Show Argl:= fName
The Argl:= fName protion generated a syntax error
message - "End of statement expected".
there must be a difference in how this works from
VB.NEt. any suggestions?
--
Dave Peterson
***@msn.com
Loading...