View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Thomas[_22_] Thomas[_22_] is offline
external usenet poster
 
Posts: 3
Default CreateEventProc causes crash

Hi Peter,

thanks for cleaning up my mess a bit ;)
I followed all your hints line by line, and still I could not solve
the problem.
The script runs fine as long as CreateEventProcedure3 is only called
once and the script is finished afterwards. As soon as I ad more code
after the call of that Sub, Excel will crash.

Sub test()
CreateEventProcedure3 "chart 1", "My Custom Chart Type"
'The next line would crash excel:
'CreateEventProcedure3 "chart 2", "My Custom Chart Type"
'this one would crash also:
'Application.Wait(Now + TimeValue("0:00:5"))
'these two lines work fine:
Application.ScreenUpdating = True
Application.VBE.MainWindow.Visible = False
End Sub

What confuses me most is the fact that if I run the script only with
the first call of CreateEventProcedure and afterwards modify the
script (edit Sheet Name) to run it again for the next sheet, it runs
smoothly. What does this mean?

surely you don't want to update the style of the chart every

time it calculates !
I need to because pivot charts loose there style each time they are
changed (KB215904)

Can anybody reproduce my issue? Any hints welcome!

Thanks and best regards,
Thomas