none
More Detailed Information From Excel COM Interop RRS feed

  • Question

  • Hi All,

    I am trying to populate a formula into an excel field (as keyed into my application by the user).  This formula may contain errors.  When I try to validate the formula by putting it into a sheet using...

                    Excel.Range cell1 = (Excel.Range)testSheet.Cells[1, 1];
                    cell1.Formula = formula;

    I get...

    Exception from HRESULT: 0x800A03EC

    Which is the de-facto standard error.  Of course if I try this in Excel it gives me a much more detailed error message (eg, 'the formula you typed contains an error', 'You've entered too few arguments for this function' etc.)

    So my question is... how can I get this detailed error information back from Excel and not just the standard 0x800A03EC error?

    Thanks!

    Wednesday, September 26, 2012 10:32 PM

Answers

  • Hi _Ray,

    Thanks for posting in the MSDN Forum.

    There might be two options which lead to that exception:

      • the cell is in edition statue.
      • your formula have error.

    I hope it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, September 28, 2012 3:01 AM
    Moderator