Exception thrown on excel cell read C#

  • Thread starter Thread starter quantus life
  • Start date Start date
Q

quantus life

Guest
I have the following method which is passed an Excel Worksheet object and an integer:


public static void State(Excel.Worksheet xlWorkSheet, int Row)
{
double StartVal;
StartVal = xlWorkSheet.Cells[Row, 21].Value2;
//OtherCode
}


In prior method calls I have been able to successfully extract the cell values using the same format however in this instance I receive the following exception:

Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x73fabe0e, on thread 0x2e5c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

If I enable Native code debugging the exception thrown pop-up in Visual Studio 2017 seems to suggest that this comes from clrjit.dll. I have searched unsuccessfully for answers so far, with most responses seem to suggest that this is a difficult problem to debug but I have at least managed to track it down to the line that throws the exception. Any help would be appreciated, thanks.

Continue reading...
 
Back
Top