Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
Excel crashes with createEventProc for a button
When I tried your code yesterday, it crashed in xl2002 for me, too.
Tina wrote: Hi, I am running the following code and Excel crashes after making the first or the second button. It also opens the code window that i dont want it to show. What should i do? Why is excel crashing? ----------------------- 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.CodeName).CodeModule .InsertLines .CreateEventProc("Click", OLEObj.name) + 1, "Msgbox ""You Clicked The Button"" " End With Next i ---------------- TIA! Tina -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel crashes | Excel Discussion (Misc queries) | |||
Excel 2007 Crashes Whenever Add-In Button is Clicked | Setting up and Configuration of Excel | |||
Excel Crashes on me | Excel Discussion (Misc queries) | |||
Excel crashes with createEventProc for a button | Excel Programming | |||
Excel crashes with createEventProc for a button | Excel Programming |