Microsoft.Office.Interop.Excel.Application app =
new Microsoft.Office.Interop.Excel.Application();
Workbook wb = app.Workbooks.Open(fname);
Worksheet ws = wb.Worksheets[1];
// read some data
var Monday = ws.get_Range("D11");
var Tuesday = ws.get_Range("D13");
I am using Microsoft.Office.Interop.Excel
to retrieve hours worked from an Excel sheet. My code seems to be working properly however I keep getting the values COM Object
for Monday
and Tuesday
.
Why is it not returning the actual values in cell D11 and D13 from my spreadsheet??
I am also getting the same COM Object
values for ws
and wb
, not sure if this has any relevance thought I would just throw that out there.
D11
? Try adding.value
to yourget_range
– crthompsonws.get_Range("D11").Text;
– user2140173