Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm writing a C# program where I need to go through a loop and add a ComboBox
to an Excel spreadsheet cell. How do I do this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I figured it out. It's actually a DropDown object I'm interested in...
protected static Excel.Application app; protected static Excel.Range range; protected static Excel.Workbook wb; protected static Excel.Sheets sheets; protected static Excel.Worksheet sheet; protected static object oMissing = Missing.Value; range = sheet.get_Range("N1", "N1"); Excel.DropDowns xlDropDowns; Excel.DropDown xlDropDown; xlDropDowns = ((Excel.DropDowns)(sheet.DropDowns(oMissing))); xlDropDown = xlDropDowns.Add((double)range.Left, (double)range.Top, (double)range.Width, (double)range.Height, true); //Add items into drop down list for (int i = 0; i < items.Length; i++) { xlDropDown.AddItem(items[i], i + 1); } |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I figured it out. It's actually a DropDown object I'm interested in...
protected static Excel.Application app; protected static Excel.Range range; protected static Excel.Workbook wb; protected static Excel.Sheets sheets; protected static Excel.Worksheet sheet; protected static object oMissing = Missing.Value; range = sheet.get_Range("N1", "N1"); Excel.DropDowns xlDropDowns; Excel.DropDown xlDropDown; xlDropDowns = ((Excel.DropDowns)(sheet.DropDowns(oMissing))); xlDropDown = xlDropDowns.Add((double)range.Left, (double)range.Top, (double)range.Width, (double)range.Height, true); //Add items into drop down list for (int i = 0; i < items.Length; i++) { xlDropDown.AddItem(items[i], i + 1); } |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting a picture into unprotected cells in a protected excelworksheet | Excel Worksheet Functions | |||
How do I add an addtional Excelworksheet tab | Excel Discussion (Misc queries) | |||
VB code to run a Query in Access and paste results onto an Excelworksheet | Excel Programming | |||
Using Excel Interop via VS.NET 2005 to create and save a new Excelworksheet.. please help! | Excel Programming | |||
can one excelworksheet address update a different box on 2nd w/s | Excel Worksheet Functions |