Rx_
Nothing In Moderation
- Local time
- Today, 16:58
- Joined
- Oct 22, 2009
- Messages
- 2,803
The Excel 2007 Recorder does not seem to register all of the parameters:
Help: need parameters to insert a list box on my Excel Worksheet - create a linked cell, and the ListRange
' this works - but leaves out the linked cell and ListFillRange
ObjXL.ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=209, Top:=36, Width:=170.25, Height:=25.5).Select
' this fails if the LinkedCell is added
ObjXL.ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, LinkedCell:="D1", _
DisplayAsIcon:=False, Left:=209, Top:=36, Width:=170.25, Height:=25.5).Select
Help: need parameters to insert a list box on my Excel Worksheet - create a linked cell, and the ListRange
' this works - but leaves out the linked cell and ListFillRange
ObjXL.ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=209, Top:=36, Width:=170.25, Height:=25.5).Select
' this fails if the LinkedCell is added
ObjXL.ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, LinkedCell:="D1", _
DisplayAsIcon:=False, Left:=209, Top:=36, Width:=170.25, Height:=25.5).Select
Code:
' ObjXL is an object reference to Excel
' **** Add List box on sheet 1 and link it to the list just created on sheet 2 *****
' (Excel Recorder for reference) Left:=206.25, Top:=36, Width:=170.25, Height:=25.5).Select
' this works - but leaves out the linked cell and ListFillRange
ObjXL.ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=209, Top:=36, Width:=170.25, Height:=25.5).Select
' this [B]fails when adding the Linked Cell[/B]
ObjXL.ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, LinkedCell:="D1", _
DisplayAsIcon:=False, Left:=209, Top:=36, Width:=170.25, Height:=25.5).Select
' Found the following on Internet - but can't seem to get it to work either
' these values are the goal
'With ObjXL.Worksheets(1).OLEObjects.Add("Forms.ComboBox.1", False, False, 206.25, 36, 170.25, 25.5)
'.Name = "Status"
'.Placement = 1
'.LinkedCell = "D1"
'[B].ListFillRange = "Sheet2!R9C2:R27C2" ' will need this next[/B]
'With ObjXL.Object
'.BorderStyle = 1
'.BorderColor = 0
'.ShowDropButtonWhen = 1
'.SpecialEffect = 0
'.Text = "APD Approved" ' also will need
'End With
'End With ' commented out while troubleshooting
' *************************************************************************************************************************************
ObjXL.Range("B8").Select ' click off the list box