![]() |
Exporting data (Data Table) to Excel
Hi,
I develop a windows application in C# and have a form with Data Table (Data Grid). I need to export it to Excel to specific path (selected by the user in SaveFileDialog). Can anybody tell me how I do it? Code example will be more than welcomed. Thank you. |
Exporting data (Data Table) to Excel
You may want to have your C# program save the data as a CSV (Preferred) or
Text (Tab delimited) file, which then Excel can take it from there and convert it into an Excel spreadsheet. Provided you know VBA in Excel, you can use the Object Browser within the VBA side of Excel to view the various constants listed within the "XlFileFormat" Class. Of course, for your C# program, you may have a different set of constants for the File Type argument, which is the second argument of the Dialogs(xlDialogSaveAs) object. -- Ronald R. Dodge, Jr. Production Statistician/Programmer Master MOUS 2000 "Vlash" wrote in message ... Hi, I develop a windows application in C# and have a form with Data Table (Data Grid). I need to export it to Excel to specific path (selected by the user in SaveFileDialog). Can anybody tell me how I do it? Code example will be more than welcomed. Thank you. |
Exporting data (Data Table) to Excel
Hi,
Check out this link.. this wil be use ful for u http://support.microsoft.com/kb/306023/ thanks, Jayavel Chakravarthy |
Exporting data (Data Table) to Excel
Good thing in there though barely even looked over it. However, from the
little glance that I took a look at, I'm not so sure about the ADO and MS Query stuff due to the memory leak issues that I have ran into using those methods, which then caused my system to have to be rebooted so much sooner. However, when you posted the link, you needed to add the "/en-us" at the end, otherwise, it just posts as an invalid page with the MS's support website area. http://support.microsoft.com/kb/306023/en-us -- Ronald R. Dodge, Jr. Production Statistician/Programmer Master MOUS 2000 wrote in message ups.com... Hi, Check out this link.. this wil be use ful for u http://support.microsoft.com/kb/306023/ thanks, Jayavel Chakravarthy |
All times are GMT +1. The time now is 07:14 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com