G Guest Sep 29, 2004 #1 I'm able to write values to an excel workbook from C#.Net code. Is there a way to read cells/values from excel to C#? Mansi
I'm able to write values to an excel workbook from C#.Net code. Is there a way to read cells/values from excel to C#? Mansi
M Mark Rae Sep 29, 2004 #2 I'm able to write values to an excel workbook from C#.Net code. Is there a way to read cells/values from excel to C#? Click to expand... Er, yeah - it's pretty much the same process... Do exactly what you're doing now but reverse the line where you write the value i.e. <ExcelCellValue> = <C#variable> becomes <C#variable> = <ExcelCellValue>
I'm able to write values to an excel workbook from C#.Net code. Is there a way to read cells/values from excel to C#? Click to expand... Er, yeah - it's pretty much the same process... Do exactly what you're doing now but reverse the line where you write the value i.e. <ExcelCellValue> = <C#variable> becomes <C#variable> = <ExcelCellValue>
G Guest Sep 30, 2004 #3 I try to do the same thing in reverse, but I'm getting a "Specific cast is not valid" error in Excel. The following line is generating this error: // Code before this line creates the excel object, opens up an existing workbook, and gets a sheet in that workbook string firstName = (string) m_objSheet.Cells[1,1]; Any ideas???? How do I convert the cell value to string? Mansi
I try to do the same thing in reverse, but I'm getting a "Specific cast is not valid" error in Excel. The following line is generating this error: // Code before this line creates the excel object, opens up an existing workbook, and gets a sheet in that workbook string firstName = (string) m_objSheet.Cells[1,1]; Any ideas???? How do I convert the cell value to string? Mansi