By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,570 Members | 999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,570 IT Pros & Developers. It's quick & easy.

c# saving an excel file without displaying dialog box.

P: 33
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
Share this Question
Share on Google+
7 Replies


kenobewan
Expert 2.5K+
P: 4,871
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

P: 33
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
Expert 2.5K+
P: 4,871
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

P: 2
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

P: 33
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
Expert 5K+
P: 5,058
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

P: 33
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.