Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting the default file name in the XLDialogSaveAs dialog box

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!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting the default file name in the XLDialogSaveAs dialog box

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


Nelson wrote in message
...
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!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Setting the default file name in the XLDialogSaveAs dialog box

Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my documents\test.xls"

is one way.


Nelson wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting the default file name in the XLDialogSaveAs dialog box


-----Original Message-----
Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my

documents\test.xls"

is one way.


Nelson wrote:

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

.


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?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Setting the default file name in the XLDialogSaveAs dialog box

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.)


Nelson wrote:

-----Original Message-----
Application.Dialogs(xlDialogSaveAs).Show arg1:="C:\my

documents\test.xls"

is one way.


Nelson wrote:

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

.


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

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
Setiiing up file name & path as a default setting on all sheets/ta Paul Canal Excel Discussion (Misc queries) 3 March 31st 06 01:07 PM
Problem setting directory in xlDialogSaveAs Jonathan Crow Excel Programming 1 September 18th 03 06:06 PM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


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