Exception from HRESULT: 0x800A03EC while adding Range.Validation

    General discussion

  • I would appreciate any insite on this issue. I'm trying to set up a simple validation cell and I think I'm doing it correctly but I keep getting the error Exception from HRESULT: 0x800A03EC.


    The code that is causing the problem is as follows:


    selection = Globals.ThisWorkbook.Application.get_Range("C3", missing);

    if (selection != null)


    selection.Validation.Add(Excel.XlDVType.xlValidateList, Excel.XlDVAlertStyle.xlValidAlertStop, Excel.XlFormatConditionOperator.xlBetween,

    "One,Two,Three,Four,Five", "");

    selection.Validation.InCellDropdown = true;





    Wednesday, May 14, 2008 4:04 PM

All replies

  • Hi Jimm,


    I copied your codes into my ThisWorkbook_Startup method. Everything works fine in my side. Cell3 is restricted to be One to Five from the comboBox.

    And in your side, which line throws the expcetion, get_Range or Validation.Add? Which language version of Office you are using? And, have you tried to install the latest service pack for Office, to see if this fixes the issue?






    Friday, May 16, 2008 9:27 AM
  • Another question... What is the context of this snippet? Are you in a button event, a change event?

    I've put it in the selection_change event and it worked fine.






    Monday, May 19, 2008 6:34 AM
  • Guys,

    I am trying to add range validation on button click in VSTO Excel document-level addin. If I am using VBA button control and corresponding macro - no problems occur. But if I try to do it via Win Forms button control and VSTO - Exception from HRESULT: 0x800A03EC appear.
    I am using ADO.NET to get appropriate values for validation list.

    Would you help me to understand what is wrong?



        Vlad Yanum

    Friday, November 26, 2010 4:09 PM