--------------------------------------------------------------------------------
1. How to add change event of Oleboject (Combobox) in activesheet of excel 2000? I am having 3 to 4 combox (oleoject) in sheet and like to add change event for each combobox.
2. How to retrieve selected value from combobox (Olebobject) & below code does not work. throwing error as script out of range.
Dim myCmdObj As OLEObject, N%, MySheet$
MySheet = "Sheet" & ActiveSheet.Index
Set myCmdObj = ActiveSheet.OLEObjects. _
Add(ClassType:="Forms.CommandButton.1", Link:=False, _
DisplayAsIcon:=False, Left:=52.5, Top:=50, _
Width:=202.5, Height:=26.25)
myCmdObj.Name = "MyButton"
myCmdObj.Object.Caption = "Button 1"
With ThisWorkbook.VBProject.VBComponents(MySheet).Codemodule
N = .CountOfLines
.InsertLines N + 1, "Private Sub Button_Click()"
.InsertLines N + 2, "End Sub"
End With
2006-08-31
00:30:39
·
1 answers
·
asked by
padam_india
1
in
Computers & Internet
➔ Programming & Design
creation of combobox at runtime very much required. Kindly suggest me a solution at runtime.
2006-09-03
22:19:21 ·
update #1