472,131 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

c# saving an excel file without displaying dialog box.

Hi frends,

In my application, a class supports backend processing. In this class im creating a new excel sheet and im inserting some data into this excel sheet, and im trying to save the file with the help of methods SAVE AND SAVE AS. But it is displaying save dialog while it is saving. But since it is backend class i dont want that dialog. Is there any other way to save the excel file without displaying save dialog .


PLZ HELP ME .

THANK U .
Dec 23 '06 #1
7 10976
kenobewan
4,871 Expert 4TB
The short answer is that the dialog box is a feature to let users control the process amd is there by default. If you work around this you lose customer focus - how are they going to know what you have downloaded and where? I suggest leaving for the benefit of your users.
Dec 23 '06 #2
So,

According to u if i left this saving to the user let me suppose that in my application if i want to create 10 excel files every time user has to operate with the dialog box (10 times) its very difficult right. that is the problem of mine.


Any way thank u for ur reply.
Dec 24 '06 #3
kenobewan
4,871 Expert 4TB
What if you were to zip the flies?
Code to easily create zip files on the fly

I am thinking about design and how you communicate with your user, gain their trust and keep them coming back. Communication is the key. I suggest giving them the choice and presenting options.

Hope that you are still smiling :).
Dec 26 '06 #4
Hi frends,

In my application, a class supports backend processing. In this class im creating a new excel sheet and im inserting some data into this excel sheet, and im trying to save the file with the help of methods SAVE AND SAVE AS. But it is displaying save dialog while it is saving. But since it is backend class i dont want that dialog. Is there any other way to save the excel file without displaying save dialog .


PLZ HELP ME .

THANK U .

hey could u send the code for SAVE and SAVEAS methods cause when i am not geeting the dialog box.It will be really helpful
thanx
Jan 19 '07 #5
hi,

Check this code

excel = new Excel.ApplicationClass();
workbooks = excel.Workbooks;
workbook = workbooks.Add(true);
ExportCurrentData(ref excel,dsData, dataSetIndex);
worksheet = (Excel.Worksheet)excel.ActiveSheet;
worksheet.Activate();
excel.saveworkspace();
Jan 19 '07 #6
Atli
5,058 Expert 4TB
Are you setting a path where the file should be saved before you trigger the save method?

Is there perhaps an overload to the save method where you can manually set the file path?

It seemes to me that the dialog box is shown becaus for obvious reasons, the class needs a place to save the file.
Jan 19 '07 #7
After u got the save dialog then u can provide the path which u want. Think initially it goes to my documents location.
Jan 19 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Vikram | last post: by
1 post views Thread by Helmut Blass | last post: by
10 posts views Thread by KeithRaginF | last post: by
2 posts views Thread by DPK | last post: by
6 posts views Thread by Eddie | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.