none
Exception from HRESULT: 0x800A03EC while adding Range.Validation

    Debate general

  • 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;

    }

    Thanks

     

    Jimm

    miércoles, 14 de mayo de 2008 16:04

Todas las respuestas

  • 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?

     

     

    Thanks,

    Ji

     

    viernes, 16 de mayo de 2008 9:27
  • 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.

     

     

     

     

     

    lunes, 19 de mayo de 2008 6:34
  • 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?

     

    Regards,

        Vlad Yanum

    viernes, 26 de noviembre de 2010 16:09