Visio 2007 hangs

Started by llmmnnoo2002, July 22, 2008, 08:18:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

llmmnnoo2002

Hello,

I am writing a C# Visio COM-AddIn for visio 2007 using Visual Studio 2005.

One of the functionalities of this AddIn is to receive a document with many shapes (usually more that a thousand) and to update a few hundreds of them from the stencils. This function can take a lot of time (usually more than 30 min), during which Visio cannot be used for anything else (status is "Not Responding" in the task manager) and the CPU usage is high. The problem is that even after the update is complete, the Visio's status remain "Not Responding" and the user is forced eventually to close it from the task manager, and all changes and updates are not saved.
I do not think there is a problem with the code, since the problem does occur if trying to update a document with fewer shapes - all shapes are updated and one can continue to use Visio. I also noticed that after a few seconds of running Visio appears twice on task manager and a process called OFFLB.exe appears in the task manager. I read that this happens when Office thinks an instance has become unresponsive and tries to recover from the error. I'm under the impression that this OFFLB might be the cause of the continual hang. Is there a way to disable OFFLB ? any ideas on how to wake Visio after the update is complete ? or any other suggestions to solve the problem ?

Thanks

Paul Herber

Have you included frequent calls to method ProcessMessages?
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

llmmnnoo2002

No I haven't. Do you mean something like Application.DoEvents() ? I tried frequent Thread.Sleep but it made no difference.

Visio Guy

Well, you're working with a LOT of shapes, is the application hanging when you open the drawing, or after you start altering it programmatically? Does it work with smaller drawings, with say, only 100 shapes?

You might try some of these performance enhancing tips:

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

llmmnnoo2002

I seem to have solved the problem. As was suggested, once I started handling messages (by using Application.DoEvents), the time it takes is reduced to a third, and more importantly, Visio does not hang.
Many thanks for the help and tips.