Export multiple datatables from a C# form to Multiple Excel sheets

T

TRBG

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,
 
J

Joel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top