G
Guest
Is it possible to access a named column in an Excel worksheet template through VB.net? I have found how to set individual cell values in the file, but am unable to reference the column by name
I am currently having to do the following
Worksheet.Cells(RowCounter, 1) = dr("Name").ToString(
where RowCounter starts at the row index I want to start at and increments while going through the datarows in a datatable. This way requires me to specify in the VB code which columns (by index) the values should go into. I would like to be able to use the named column from the Excel template to specify the column. This way, the users could add columns to the template, and the data would still appear in the correct columns
Any ideas?
I am currently having to do the following
Worksheet.Cells(RowCounter, 1) = dr("Name").ToString(
where RowCounter starts at the row index I want to start at and increments while going through the datarows in a datatable. This way requires me to specify in the VB code which columns (by index) the values should go into. I would like to be able to use the named column from the Excel template to specify the column. This way, the users could add columns to the template, and the data would still appear in the correct columns
Any ideas?