Word-2003 VBA winword.exe is running under 'processes' but not ope

A

Avi

winword.exe is running under 'processes' but not open under application

hi,

to close the application from VBA i am using the command

Application.Quit wdDoNotSaveChanges

the application closes, in the application tab of task manager, nothing is
there but when i open processes in task manager i can see that the
WINWORD.EXE is still running.
why winword is still running. it happnes some time not all the time. please
suggest how to overcome this problem.

The machine in which i am running it contains two processor.

let me know if any more information needed.
 
R

Russ

You may sometimes have more than one instance of Word started and maybe some
may have 'hung up' and not finished completely in order to show their
instance of the application on the screen. I have had that problem before
when impatiently trying to start Word while Windows was still trying to
start from a reboot. I would keep clicking on the Word launch button in the
Office launchbar, when I didn't see any results, which just starting more
instances of winword.exe tasks. That was on W2000 and Word97 at work.

You can experiment by trying this procedure:

Before running Word, make sure that no winword.exe is running in the task
manager.
Open up Word and make sure only one winword.exe is running in the task
manager.
Run your code to quit, and check if winword.exe is still running in the task
manager.
 
N

Nyarla

Oh! This may not apply to you, but it may help.

Your problem reminds me of something I had in the past. I had it when I was
using Access to fill-in a Word file. Access (or any other application) has
to set its Word pointer to nothing after use; a little like this.

Example code running in Access... Forgive me the detail, it was long ago.

Set WordObject = new Word.Application
WordObject.DoSomething
WordObject.DoSomeMore
...
WordObject.CurrentDocument.Close ...Parameters...

Set WordObject = Nothing 'That's what I mean here: clear the pointer


I might be because you're using another application that has a pointer open
on Word. That's the way COM works behind the scenes. Objects are kept alive
as long as there are pointers "pointing" to them. Setting a VBA object
variable to nothing implicitly calls the "RemoveReferenceCount" function of
the IUnknown interface (don't quote me on the specific names; I'm not a COM
developper).
 

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