Syntax

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

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data Type Description
Type Required The Microsoft Excel control type. You cannot create an edit box on a worksheet.
Left 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.
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 Required Long The initial size of the new object, in points.
Height Required Long The initial size of the new object, in points.

Return Value
Shape

Remarks

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

Example

This example adds a list box to worksheet one and sets the fill range for the list box.

Visual Basic for Applications
With Worksheets(1) Set lb = .Shapes.AddFormControl(xlListBox, 100, 10, 100, 100) lb.ControlFormat.ListFillRange = "A1:A10" End With
add Add another form control to my worksheet? Add command button to sheet? add form control Add Form Control Method addform AddFormControl AddFormControl Method Insert a checkbox into a chart?

See also: