Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
Run time error '9' Subscript out of range
Hi,
I am getting an error in the following code at the line marked with ****. Any ideas why?? ----------------------- Workbooks("Game").Sheets("Data").Activate Dim OLEObj As OLEObject For i = 0 To 4 Set OLEObj = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Comma ndButton.1", Link:=False _ , DisplayAsIcon:=False, Left:=50 + i * 100, Top:=10, Width:=80, Height:= _ 25) OLEObj.name = "TheButton" & i ' ' Create the event procedure ' With ActiveWorkbook.VBProject.VBComponents(OLEObj.Paren t.name).CodeModule **** error here .InsertLines .CreateEventProc("Click", OLEObj.name) + 1, "Msgbox ""You Clicked The Button"" " End With Next i ---------------- TIA! Tina |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run-time error '9': subscript out of range | Excel Discussion (Misc queries) | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
Run Time Error 9 (Subscript out of Range) for XLA file | Excel Discussion (Misc queries) | |||
Run time error 9 : Subscript out of range | Excel Discussion (Misc queries) | |||
Run time error 9 (subscript out of range) | Excel Programming |