Range in the Excel Interop library has Left and Top properties. These are of type Object as stated on MSDN. Trying to cast the result to float gives an error.
Code:
var lastcell = sheet.Cells[row, 1] as Excel.Range;
var topOffset = (float)(lastcell.Top);
Error:
Specified cast is not valid.
How can I retrieve the value as a float (or double..)?
I beileve the results is a double rather than a float so:
should work.