--------------------------------------------------------------------------------
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
Programming & Design