J
Jim Warren
HERE'S THE CODE:
Dim NDXcode As String, StartLine As Long
NDXcode = ActiveSheet.CodeName
With ActiveWorkbook.VBProject.VBComponents(NDXcode).CodeModule
StartLine = .CreateEventProc("SelectionChange", "Worksheet")
.InsertLines StartLine, _
<TEXT IS INSERTED HERE>
HERE'S THE ERROR:
" the object invoked has disconnected from its client" and Excel crashes
THE ERROR OCCURS AT .InsertLine StartLine,...BUT IT ALSO HAPPENS IF I SINGLE
STEP TO THE PREVIOUS LINE AND TYPE IN THE IMMEDIATE WINDOW "Print StartLine"
Dim NDXcode As String, StartLine As Long
NDXcode = ActiveSheet.CodeName
With ActiveWorkbook.VBProject.VBComponents(NDXcode).CodeModule
StartLine = .CreateEventProc("SelectionChange", "Worksheet")
.InsertLines StartLine, _
<TEXT IS INSERTED HERE>
HERE'S THE ERROR:
" the object invoked has disconnected from its client" and Excel crashes
THE ERROR OCCURS AT .InsertLine StartLine,...BUT IT ALSO HAPPENS IF I SINGLE
STEP TO THE PREVIOUS LINE AND TYPE IN THE IMMEDIATE WINDOW "Print StartLine"