473,657 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c# saving an excel file without displaying dialog box.

33 New Member
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 11142
kenobewan
4,871 Recognized Expert Specialist
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
alwayssmiling
33 New Member
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 Recognized Expert Specialist
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
NBKMNDN
2 New Member
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
alwayssmiling
33 New Member
hi,

Check this code

excel = new Excel.Applicati onClass();
workbooks = excel.Workbooks ;
workbook = workbooks.Add(t rue);
ExportCurrentDa ta(ref excel,dsData, dataSetIndex);
worksheet = (Excel.Workshee t)excel.ActiveS heet;
worksheet.Activ ate();
excel.saveworks pace();
Jan 19 '07 #6
Atli
5,058 Recognized Expert Expert
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
alwayssmiling
33 New Member
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

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

Similar topics

3
12369
by: Vikram | last post by:
Hi, Given below is my task. An user can open the xls file from my website (loaded on the top frame). After filling the Excel, he can click a send button at the bottom frame. By clicking the button i have to save the file in a shared directory on the web server by a unique name. Is it possible ?
1
2211
by: Helmut Blass | last post by:
hi Access-freaks, in MS Access, I generate an Excel file where the user should have the possibility to determine the excel file name by file dialog. so I use the following command: xlapp.Dialogs(xlDialogSaveAs).Show (xlapp being Excel.Application) just at this point the Access Application stops and must be cancelled by the task manager.Only after cancelling Access, the File dialog
10
2211
by: KeithRaginF | last post by:
Hello I am trying to return the contents of an Excel file. However, I don't want to just redirect the request to the Excel file since it does not reside in a location where that is appropriate. I am trying to write the contents of the file to the response but am having trouble. My code resides in the handler for a link-button's click event Response.ClearHeaders() Response.ClearContent() Response.ContentType =...
1
5148
by: NBKMNDN | last post by:
Hi frends, In my C# application 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 method SAVE AS. But it doesnot displays save dialog while it is saving. how to save the excel file by displaying save dialog in c#. THANK U .
2
3823
by: DPK | last post by:
Hello friends!!! I made a prog. to make the excel. It is running well but when it saves the excel file it open the save dialog box to save the file becasue I am using SAVE function here instead of SAVE AS. So pls can anyone tell me how to use SAVE AS function in it so that i could give File name from my Programe. If I am using "Save As" Function then I am getting Error. My be I am not giving appropriate parameters. ERROR IS :
6
3359
by: Karl | last post by:
Hi all, It may seem like a rather odd request (or not) but I would like to be able to create a file (doc, jpg, xls or one of many other files that can be automated) on a website and stream it to a user without saving it to the disk first. Obviously saving the file first and streaming it afterwards is fairly easy to do, but it relies on disk write permissions on the server and you'd have to make sure the file was removed afterwards.
0
1120
by: veer | last post by:
hello expert i am facing a probleum of saving the out put in excel sheet actually i have two buttons on my vb form i,e merge entery and merge verify and when i execute my program one by one means execute "merge entery" procedure first and check the report on excel file and save in another file and then execute "merger entery" it works fine but when i execute both of them contineously means first merge entery and then merge verify the...
6
8065
by: Eddie | last post by:
Hi all, I am displaying a number of reports, and giving the users an option to display them on the web or download them to Excel. If they want the Excel file, I just use the PHP header command to change the Content- Type and Content-Disposition headers, and essentially print the same report, and it's done. That works fine. But in some reports on the web I need to show images. The web part is fine, but I'm having a tough time...
6
26305
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this one table. My problem is I have two buttons I want to use this code for for the two buttons would put the data in different tables. I have tried copying and changing a few things and nothing will work for me. The code is set up in a module and then I...
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.