Is this crashing for you ?
Folks
Is this also crashing your Excel ?! If so anything obvious I might have missed ?
----
Sub doStuff()
Dim x As OLEObject
Dim aName As String
For Each x In ActiveSheet.OLEObjects
aName = x.Name
With ThisWorkbook.VBProject.VBComponents(ActiveSheet.Co deName).CodeModule
.InsertLines .CreateEventProc("Click", aName) + 1, _
"Msgbox ""Hi there"" "
End With
Next x
End Sub
|