keyongtech


  keyongtech > excel.* > excel.programming > 05/2008

 #1  
05-01-08, 04:41 PM
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,
 #2  
05-02-08, 06:24 AM
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.
"TRBG" wrote:
[..]
Similar Threads
export multiple sheets to multiple excel files

I have a workbook with approx 30 sheets. I am trying to figure out how to save each sheet as it's own workbook (using the name of the worksheet as the file name) without...

Name multiple sheets in excel export?

I have a report that when exported to Excel creates multiple sheets. Im doing this on purpose. I wanted know if anyone new a way to automatically name the Sheets in the Excel...

Export multiple queries to multiple Sheets in Excel

I'm using the TransferSpreadsheet function in vba to export a query to an Excel file. I have 5 queries that I would like to export (via vba) to 5 separate Sheets in a single...

Export to multiple excel sheets

Hi Everyone, I am trying to export a group of tables to an excel workbook and I would like to export table 1 to sheet 1, table 2 to sheet 2 etc. I am using...

export to Excel - multiple sheets & renaming sheets

I'm developing a website for work that exports some reports to excel. I am using the... Response.AddHeader...


All times are GMT. The time now is 11:06 PM. | Privacy Policy