0

I want to programatically choose one of the options available in a Excel Dropdownlist. To manipulate the worksheet I'm using win32ole on ruby. It works well until I try to change the value of the dropdownlist.

I simply don't know how and google has been of no help.

setting a value to a a cell is as simple as worksheet.Cells(x,y).Value=new_value. This is not choosing one of the alternatives available on the dropdownlist and it's not even possible since the cell in question is protected.

The protection doesn't stop me from changin the value manualy via excelso I figure there must be a method or functon somewhere that allows me to simulate this action aswell.

Help in advance for any suggestions.

EDIT: I'm trying to choose one of the values available in the dropdown list.

4

1 回答 1

0

我没有找到特定于 dropdows 的 api,但我设法解决了问题。下拉列表的数据位于工作簿中的某处。只需从它们中选择并将其设置为带有“Cells.Value=new_value”的下拉单元格。

这对我来说有点不同,因为我正在处理的工作簿有某种受保护的自定义下拉菜单,但最重要的是,解决方案是意识到下拉菜单的数据可以在工作簿的其他地方找到。

于 2013-04-29T08:53:47.077 回答