View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ronald Dodge Ronald Dodge is offline
external usenet poster
 
Posts: 111
Default 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.