Shapes.AddFormControl (Excel)

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

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

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


With Worksheets(1) 
 Set lb = .Shapes.AddFormControl(xlListBox, 100, 10, 100, 100) 
 lb.ControlFormat.ListFillRange = "A1:A10" 
End With

Arguments

The following arguments are required:

Type (XlFormControl) - The Microsoft Excel control type. You cannot create an edit box on a worksheet.

Here you can find possible values for XlFormControl

Left (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 (Long) - The initial coordinates of the new object (in points) relative to the top of row 1 on a worksheet, or to the top of the chart area on a chart.

Width (Long) - The initial size of the new object, in points.

Height (Long) - The initial size of the new object, in points.