AddFormControl Method

AddFormControl Method

         Example         Applies To

Creates a Microsoft Excel control. Returns a Shape object that represents the new control.

Syntax

expression.AddFormControl(Type, Left, Top, Width, Height)

expression   Required. An expression that returns a Shapes object.

Type   Required Long. The Microsoft Excel control type. Can be one of the following XlFormControl constants: xlButtonControl, xlCheckBox, xlDropDown, xlEditBox, xlGroupBox, xlLabel, xlListBox, xlOptionButton, xlScrollBar, or xlSpinner. You cannot create an edit box on a worksheet.

Left, Top   Required Long. The initial coordinates of the new object (in points) relative to the upper-left corner of cell A1 on a worksheet or to the upper-left corner of a chart.

Width, Height   Required Long. The initial size of the new object, in points.

Remarks

Use the AddOLEObject method or the Add method of the OLEObjects collection to create an ActiveX control.