Explainer
Why WinCC ComboBox item insertion needs the control's own methods
Short answer
WinCC scripts every ActiveX control in a picture through the same pattern, so a ComboBox that refuses entries is not a WinCC problem: the calls must be the members the placed control exposes. Identify the control, call its documented insertion method — AddItem on the Forms 2.0 ComboBox — and build a custom ActiveX control only when no insertion member exists.

On this page
Inserting entries into a ComboBox under WinCC fails for a reason that has nothing to do with WinCC settings: picture scripts reach every ActiveX control through the same pattern, and only the properties and methods of the control you placed decide which calls work. Most sample code targets list boxes, so the ComboBox reports a missing member the moment the code is pasted in. The fix is to call the members your ComboBox actually exposes — on the Microsoft Forms 2.0 ComboBox that insertion method is AddItem — and to build a custom ActiveX control only when the placed control has no insertion member at all. This article shows how to identify which ComboBox sits in your picture, how to translate list-box code onto it, and a worked example that fills a ComboBox named ComboBox1 with two entries on one button click.
One scripting pattern, one object model per control #
The gap reported in WinCC V5.1, and again for V6.0, comes from copying between two different controls. WinCC's own scripting does not change between a list box, a ComboBox or any other ActiveX control: obtaining the picture object and calling into it follows one pattern for all of them. What changes completely is the object model of the control — which property holds the list, which method appends an entry, which members report the selection. A member that exists on a list box has no obligation to exist on a ComboBox, and when it does not, runtime raises a missing-member error on exactly that line.
The decision that follows: treat any list-box example as a template for the WinCC side of the script only, and replace every control-specific member with one the placed ComboBox documents. The script language does not lift this rule — VBS and C script both bind to the same member list. Where Visual Basic itself stops inside a WinCC project is its own subject, covered in what Visual Basic can and cannot do inside a WinCC project.
Identify which ComboBox is in the picture #
WinCC pictures can hold two objects that both look like a combobox, and they script differently, so identify yours before writing calls.
The built-in smart object is inserted by clicking the "Combobox" smart object in the "Standard" selection window of the open picture, as the WinCC V7.5 working-with-WinCC documentation describes. Its list entries are configuration: the documentation for changing control properties sends you to the "Object Properties" dialog, which the object's shortcut menu opens through its "Properties" entry.
An ActiveX ComboBox is inserted from the "Default" selection window or the "Controls" tab, the route the WinCC V8.0 documentation gives for ActiveX controls in process pictures. Which ComboBox you get depends on what is registered on the engineering station: with Microsoft Office installed, the Forms 2.0 ComboBox is available, and it is the control whose script members are publicly documented, AddItem among them.
The decision: know where the object came from before the first member call. Code checked against the wrong control's member list can never run.
Map list-box code onto the ComboBox members #
Sort every line of the list-box example into two groups.
WinCC-side lines — finding the picture object, reading a tag, reacting to the event — survive unchanged, because that pattern is identical for any ActiveX control.
Control-side lines — every property read and method call aimed at the control — are replaced. For each one, look the member up in the placed ComboBox's own reference and substitute the documented equivalent:
- The call that appends one entry: on the Forms 2.0 ComboBox this is AddItem, the method Microsoft's Forms reference uses to populate the ComboBox choices in its own example.
- The members that report the selected entry and the list contents: take their names from the ComboBox reference, not from the list-box example — the documentation around this exact problem never shows a shared name, and that is the point.
- Any member with no documented equivalent on the ComboBox: delete the line. Left in, it buys a runtime error instead of behavior.
A member that exists on both controls still needs its argument list checked in the ComboBox reference; matching names do not promise matching parameters.
Worked example: filling ComboBox1 with two entries on one button click #
This is the case a documented WinCC 7.x example solves directly: a combobox with the object name ComboBox1, two text entries, filled when a button in the same picture is clicked.
Inputs, each with their source:
- Object name ComboBox1 — from the documented WinCC 7.x example of this exact operation.
- Two text entries — same example; the strings below, "Line 1" and "Line 2", are example texts.
- Trigger: a button click in the same picture — same example.
- Insertion member AddItem — documented for the Forms 2.0 ComboBox in Microsoft's Forms reference; it applies when that control is the one placed, which requires Microsoft Office on the station that supplies it.
- Script language — the documented example runs as C script on WinCC 7.x; the insertion calls themselves keep the same shape from VBS.
Rule in words: obtain the control object from the open picture the way your script language and WinCC version document for addressing a picture object, then call the insertion member once per entry, passing the entry text as the argument. How that reference is obtained differs between script languages and versions, so it follows your documented pattern; the two calls below are the part that changes between controls. Only AddItem is a documented member name here, and entryA and entryB are illustrative variables holding the entry text; comboBoxControl stands for the object reference your script holds:
Dim entryA, entryB
entryA = "Line 1"
entryB = "Line 2"
comboBoxControl.AddItem entryA ' the documented insertion member of the Forms 2.0 ComboBox
comboBoxControl.AddItem entryB
Result: click the button in runtime, open the dropdown, and both entries appear in insertion order — that read-back is the test that proves the example. If either call errors, the placed control does not expose AddItem and the script is not what needs changing.
Decision: with the Forms 2.0 ComboBox placed, these two calls are the whole answer, one call per entry. With any other ComboBox placed, stop debugging the script and go to the control's member list — the fix is a different member name or a different control, not different WinCC code.
When the placed control has no insertion member #
The fallback that solved the original problem for one engineer was to write a custom ActiveX control exposing exactly the members needed. That is an evidenced workaround and the last resort, not the default. Confirm the standard control genuinely lacks the interface first, from the control vendor's own member list, because a control that documents an insertion member needs no custom code at all.
For a fixed list, skip scripting entirely: the built-in Combobox smart object takes its entries statically in the "Object Properties" dialog. The picture documentation presents those entries as configuration and does not evidence any script member that inserts into the smart object at runtime, so for a list that must change while runtime runs, place the Forms 2.0 ComboBox and call AddItem.
The decision, in order: a documented insertion member on the placed control — call it. A fixed list — configure the smart object statically. No insertion member anywhere and a runtime-driven list required — write the custom ActiveX control. Once a custom component exists, calling it from scripts is its own interface question; why a VB ActiveX DLL does not work from WinCC C scripts covers one case that catches people out.
Verify on the runtime picture #
Run the check where the picture runs, not in the editor:
- Trigger the fill and open the dropdown: every intended entry appears, in insertion order.
- Select an entry and read the value back through the members the ComboBox reference documents, not through a list-box property name, and confirm it matches the entry shown.
- Reopen the picture and fill again: whether the list resets, persists or duplicates is behavior of the control and the fill logic, so observe it deliberately once instead of assuming.
- Separate the two failure classes: an error naming the member is a control-interface problem and points at that line; correct member names that still fail point at how the script obtains the picture object.
One more runtime check matters: the runtime PC must supply the control too. The Forms 2.0 ComboBox comes with Microsoft Office, and a runtime machine without it loads a different or missing control — compare what is registered on both machines when behavior differs between engineering and runtime.
Questions asked
How do I fill a WinCC ComboBox with values that come from the PLC?
Read the tags first, then pass each value to the insertion member as text, one call per entry. The ComboBox never talks to the controller; the script does the reading and the inserting. Refill the list deliberately instead of appending on every acquisition cycle, so a repeated poll cannot insert the same entry twice.
Does this apply to WinCC V5.1 and V6.0, where the problem was reported?
Yes, and the reason is version-independent: the rule comes from ActiveX, not from a WinCC release. The pattern around the control is the same in V5.1, V6.0 and the later V7 and V8 pictures, and only the control's own members decide which calls work. What changed across versions is which ComboBox controls the picture editor offers and which selection window they insert from.
Where is the member list of my placed ComboBox documented?
In the control vendor's own reference, not in WinCC's. Microsoft documents the Forms 2.0 ComboBox members, AddItem included, in its Office Forms language reference; a third-party control is documented by whoever supplies it. The "Object Properties" dialog shows the attributes WinCC lets you configure statically, which is a separate thing from the script member list that decides which calls run.
What about removing entries or clearing the list?
Whatever member the placed control documents for list management runs through the same script pattern as insertion. The Microsoft Forms reference that documents AddItem for the Forms 2.0 ComboBox documents its companion list members on the same pages, so take removal and clearing from there. A list-box member name carried over without checking is the same trap this problem started with.

