Gowri A

Gowri A

  • NA
  • 54
  • 47.2k

how to use Excel indirect function in c#

Jul 8 2014 3:19 AM
Hello,
        I'm trying to run excel indirect function from c#. I used the following code but got the exception "A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Dynamic.dll"

Additional information: Exception from HRESULT: 0x800A03EC


Excel.Range vehicle_makes_dropdown = xlWorkSheet1.get_Range("B2", "B101");
vehicle_makes_dropdown.Formula = "=indirect(A2)";
vehicle_makes_dropdown.Validation.Add(Excel.XlDVType.xlValidateList, XlDVAlertStyle.xlValidAlertInformation, XlFormatConditionOperator.xlEqual, vehicle_makes_dropdown.Formula, misValue);

vehicle_makes_dropdown.Validation.IgnoreBlank = true;
vehicle_makes_dropdown.Validation.InCellDropdown = true;




Answers (1)