ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Export multiple datatables from a C# form to Multiple Excel sheets (https://www.excelbanter.com/excel-programming/410323-export-multiple-datatables-c-form-multiple-excel-sheets.html)

TRBG

Export multiple datatables from a C# form to Multiple Excel sheets
 
How do I export multiple datatables from a C# form to Multiple Excel sheets
using a datagrid with htmlwriter so it is simple, fast and efficient but can
do it to mulitple worksheets. right now that method export html but all on
one spreadsheet

Thanks,
--
TRBG

joel

Export multiple datatables from a C# form to Multiple Excel sheets
 
I don't know #C syntax but it will be something like this

1) You can create a list of worksheet names in an array

char SheetNames[] = {"Sheet1","Sheet2"}

then reference the sheets from an arrray

2) Get every worksheet from the workbook

Sheets = Myworkbook.Sheets.Count
for SheetCount = 1 to Sheets {
data= MyWorkbook.Sheets(SheetCount).Range("A1")
}


I haven't used C Language in a while so I'm a little bit rusty. But I think
you can figure out the rest. From excel you should be able to get a count of
the worksheets in a workbook and then reference the sheets by number.
"TRBG" wrote:

How do I export multiple datatables from a C# form to Multiple Excel sheets
using a datagrid with htmlwriter so it is simple, fast and efficient but can
do it to mulitple worksheets. right now that method export html but all on
one spreadsheet

Thanks,
--
TRBG



All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com