Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Populate a ComboBox from C#

Mar 4 2003 9:29 PM
I am using the Excel.Application obect in my C# code to manipulate an XLS spreasheet, and all has gone good, until I hit a Dropdown box. I cannot seem to find the call to either get or place the value of a dropdown box. for a cell, it was easy: Excel.Range singleVal = (Excel.Range)worksheet.Cells.get_Item(cellRow,cellColumn); return singleVal.Value.ToString(); But I cannot seem to replicate this with A dropdown (sometimes called a Listbox? or ComboBox?) I have seem to gotten the object with this call: worksheet.DropDowns(1) but when I try to cast it into a range, I get an error. What else can I cast it into to get/place a value? Thanks! Marty

Answers (1)