A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Visio
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DoEvents alternative



 
 
Thread Tools Display Modes
  #1  
Old September 2nd, 2008, 03:20 PM posted to microsoft.public.visio.general
Anders
external usenet poster
 
Posts: 72
Default DoEvents alternative

Hi!

We are splitting a large page into several small pages. In order to do that
we remove lines from the geometry section in a shapes shapesheet. When a row
is deleted (for instance a LineTo row) we need to perform a DoEvents i the VB
code. Otherwise the segment is not removed.

The problem is that all these DoEvents makes the split functionality very
slow. Is there another way to do this?

/Anders
  #2  
Old September 3rd, 2008, 02:02 AM posted to microsoft.public.visio.general
Al Edlund[_2_]
external usenet poster
 
Posts: 144
Default DoEvents alternative

The doevents in Vba is what gives the cycles back to the system to get some
work done and I use it a lot. That said, in a dotNet world it absolutely will
fry performance.
Some things to look at :

consider putting in a formula modified event processor to put a throttle on
the things that you really need. (I use two event processors, one for
doc/page events that I need and one to watch the other events that I want).

consider wrapping your busy code in something like this
ThisDocument.Application.DeferRecalc = True
ThisDocument.Application.InhibitSelectChange = True
ThisDocument.Application.ScreenUpdating = False
don't forget to turn the stuff back when your done

consider wrapping your busy code in begin/undo scope so that your application
has a flag for when your busy.

HTH
al

"Anders" wrote:

Hi!

We are splitting a large page into several small pages. In order to do that
we remove lines from the geometry section in a shapes shapesheet. When a row
is deleted (for instance a LineTo row) we need to perform a DoEvents i the VB
code. Otherwise the segment is not removed.

The problem is that all these DoEvents makes the split functionality very
slow. Is there another way to do this?

/Anders

  #3  
Old September 3rd, 2008, 02:08 AM posted to microsoft.public.visio.general
Al Edlund[_2_]
external usenet poster
 
Posts: 144
Default DoEvents alternative

forgot to mention that the formula changed event processor is based on using
filters, there's a good example in the visio sdk
al


"Al Edlund" wrote:

The doevents in Vba is what gives the cycles back to the system to get some
work done and I use it a lot. That said, in a dotNet world it absolutely will
fry performance.
Some things to look at :

consider putting in a formula modified event processor to put a throttle on
the things that you really need. (I use two event processors, one for
doc/page events that I need and one to watch the other events that I want).

consider wrapping your busy code in something like this
ThisDocument.Application.DeferRecalc = True
ThisDocument.Application.InhibitSelectChange = True
ThisDocument.Application.ScreenUpdating = False
don't forget to turn the stuff back when your done

consider wrapping your busy code in begin/undo scope so that your application
has a flag for when your busy.

HTH
al

"Anders" wrote:

Hi!

We are splitting a large page into several small pages. In order to do that
we remove lines from the geometry section in a shapes shapesheet. When a row
is deleted (for instance a LineTo row) we need to perform a DoEvents i the VB
code. Otherwise the segment is not removed.

The problem is that all these DoEvents makes the split functionality very
slow. Is there another way to do this?

/Anders

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.