R
Robert Stober
Hi,
I've been over and over it, and I can't find anything wrong. But it doesn't
work. It crashes Excel every time. I got it from a smart guy named Chip
Pearson (thank you Chip). To be specific, I added the variables inside the
named "String" arguments, but it didn't work before I did that either. It
*almost* works, then crashes...
' Insert SelectionChange event procedure
With
ActiveWorkbook.VBProject.VBComponents(ActiveWorkbook.Worksheets("Contents").
CodeName).CodeModule
.InsertLines Line:=.CreateEventProc("SelectionChange","Worksheet") + 1,
_
String:="If Not Intersect(Target, Range(""" & nextCell & """)) Is
Nothing Then" & VbCrLF & _
" Charts(""" & chartName & """).Activate" & VbCrLF & _
"End If"
End With
Any ideas?
Thank you,
Robert Stober
I've been over and over it, and I can't find anything wrong. But it doesn't
work. It crashes Excel every time. I got it from a smart guy named Chip
Pearson (thank you Chip). To be specific, I added the variables inside the
named "String" arguments, but it didn't work before I did that either. It
*almost* works, then crashes...
' Insert SelectionChange event procedure
With
ActiveWorkbook.VBProject.VBComponents(ActiveWorkbook.Worksheets("Contents").
CodeName).CodeModule
.InsertLines Line:=.CreateEventProc("SelectionChange","Worksheet") + 1,
_
String:="If Not Intersect(Target, Range(""" & nextCell & """)) Is
Nothing Then" & VbCrLF & _
" Charts(""" & chartName & """).Activate" & VbCrLF & _
"End If"
End With
Any ideas?
Thank you,
Robert Stober