M
Manuel Wenk [MCP ASP & WinForms]
Hi, I've got a problem developing an Excel Addin. I'm trying to read values
out of single Cells in a worksheet, I'm using the
Microsoft.Office.Interop.Excel.dll for .NET
together with Excel 2003.
I've splitted the code a little bit to circle in the Problem. Imediatley at
the first statement Cell[...] the Programm throws an COMException
(DISP_E_TYPEMISTMATCH).
Sheet contains a valid worksheet reference, CellID contains "G3" wich is an
vaild Cell with an Value in it.
Can someone give me a hint or any other Code to read single Values out of
Worksheet-Cells ?
private object ReadCell(string cellId, Excel.Worksheet sheet)
{
object o1 = sheet.Cells[cellId, Type.Missing];
Excel.Range range = (Excel.Range)o1;
object rv = range.Value2;
return rv;
}
Thanks in advance,
Manuel Wenk
out of single Cells in a worksheet, I'm using the
Microsoft.Office.Interop.Excel.dll for .NET
together with Excel 2003.
I've splitted the code a little bit to circle in the Problem. Imediatley at
the first statement Cell[...] the Programm throws an COMException
(DISP_E_TYPEMISTMATCH).
Sheet contains a valid worksheet reference, CellID contains "G3" wich is an
vaild Cell with an Value in it.
Can someone give me a hint or any other Code to read single Values out of
Worksheet-Cells ?
private object ReadCell(string cellId, Excel.Worksheet sheet)
{
object o1 = sheet.Cells[cellId, Type.Missing];
Excel.Range range = (Excel.Range)o1;
object rv = range.Value2;
return rv;
}
Thanks in advance,
Manuel Wenk