Instance of Winword remains in Task Manager

  • Thread starter Devesh Aggarwal
  • Start date
D

Devesh Aggarwal

I am using VBA Application to make a custom toolbar programmatically &
sending data fields to a winword document. In the design mode when the user
invokes word from our application does the designing, it works perfectly.

But when he saves the file & closes word, an instance of winword still
remains in the task manager. This causes issue when i try to invoke winword
again for second document. In windows 98, it gives exception error
indicating error in ole32.dll.

Any solution for the same?

Devesh Aggarwal
 
C

Cindy M -WordMVP-

Hi Devesh,

Very difficult without seeing the code. Generally, though, this problem is
caused by pointers to the Word object in your code that haven't been released
properly. So I'd say: make sure you set all the object variables that have to
do with Word to "Nothing" before handing control of the Word window to the
user.
I am using VBA Application to make a custom toolbar programmatically &
sending data fields to a winword document. In the design mode when the user
invokes word from our application does the designing, it works perfectly.

But when he saves the file & closes word, an instance of winword still
remains in the task manager. This causes issue when i try to invoke winword
again for second document. In windows 98, it gives exception error
indicating error in ole32.dll.

Any solution for the same?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

Cindy M -WordMVP-

Hi Malcolm,
....and, indeed, to make sure that the Application is closed properly
before releasing the pointers.
Well, I'm not sure that's appropriate in this case:

"But when he saves the file & closes word..."

Word differs from some other applications in this respect, such as
Access. I recall trying to automate that, and when I'd set the object
variables to "Nothing", the application disappeared (closed). Something
of a shock :) But Word was designed so that you could automate it and
leave it open. You just have to be careful to set the object variables
to nothing. And make sure they're going to go out of scope when your
procedure ends. Or else be sure to use Get Object, then test for Nothing
when the automating application ends and use Application.Quit if
necessary.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top