Hi
I have still problem to convert a cell value to double...
we have already the code ,below, that can read an excel file
I tried to convert the cell value to double (double x = Convert.ToDouble(oSheet.Cells.Cells[1, 1]);) but there is an error:
how it is possible to convert the cell value obtained from excel to Double?
Unable to cast COM object of type 'System.__ComObject' to interface type 'System.IConvertible'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{805E3B62-B5E9-393D-8941-377D8BF4556B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
_________________________________________________________
using
namespace
{
App =
oBooks =
oBook =
oSheet =
App.Visible =
oBooks = App.Workbooks;
oBook = oBooks.Open(filepath,
oSheet = (
* range */
//You can get or create another sheet and transmit the content
oSheet2.Cells.Cells[1, 1] = oSheet.Cells.Cells[1, 1];
}
oBook.Save();
App.Quit();
System.Runtime.InteropServices.