LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Application Crash Whie adding Code lines using VBA

Although CreateEventProc ensures the event is correctly written, providing
the control already exists, it has the possible disadvantage of opening the
VBE to display the new event. Also I very much doubt it would prevent the
crash problem, which I'd bet is related to an untimely recompile of the
project while the code is running. That depends of course on what you are
doing overall as I mentioned previously.

In the AddLabel routine I posted, forgot to remove a couple of lines
accidentally left in for my own testing.

Set ole = ws.OLEObjects(2)
and a bit further down -
Set ole = ws.OLEObjects(1).

Regards,
Peter T


"Amit Kumar" wrote in message
...
I already tried using CreateEventProc... But getting same error.

"Robert Bruce" wrote:

Yn newyddion: ,
Roedd Peter T <peter_t@discussions wedi ysgrifennu:

I've amended your routine slightly and with the test all seems to
work OK. Having said that, there are scenarios where adding event
code to class modules can cause the project to recompile and crash
Excel (eg under certain circumstances when adding new code to the
project that's running the insert new code).

If the following doesn't work it's probably related to what you are
doing overall.


See also the CreateEventProc method.

Rb





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding code lines with vba code thread Excel Programming 4 February 6th 08 01:31 PM
Application makes VBE crash. How do I troubleshoot? Bdra Excel Programming 4 January 10th 08 08:27 AM
Adding code to control on form causes Excel to crash skuzapo Excel Programming 3 September 22nd 05 09:14 PM
Adding code to a control on a form causes excel to crash Skuzapo Excel Programming 1 September 21st 05 02:13 PM
Application.Quit en Excel crash Jos Vens[_2_] Excel Programming 4 April 8th 05 01:27 PM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"