I am running this code:
string[] lStats= new string[] { "Overboard" };
dynamic totalStats = oXL.ActiveWorkbook.Sheets[1].Cells.Find(lStats, XLFindLookIn.xlValues, XlLookAt.xlWhole).Offset[0,4].Value;
And it throws a COMException was unhandled. Type Mismatch(Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
Loading
VulpesPosted Feb 15, 2013, 5:06 AM
To deal with this I'd try using 'named' parameters for the second and third arguments:
dynamic totalStats = ws1.Cells.Find(lStats, LookIn : XlFindLookIn.xlValues, LookAt : XlLookAt.xlWhole).Offset[0,4].Value;