References to WINWORD.EXE still alive.

  • Thread starter Thread starter Robin Tucker
  • Start date Start date
R

Robin Tucker

Hi,

I am diligently releasing (Marshal.ReleaseComObject (o) ) all references I
pick up while generating a report using VB.NET in my software. At least, I
*think* I am. However, when I have finished using the WINWORD.EXE com
server, I still have a reference to it hanging somewhere in my code (I know
this because it remains in task manager). I have checked and double checked
but can't find it (although of course I am sure it must be there somewhere).
So my question is: are there any tools or is there any programmatic method I
can use to determine whether or not I have any references to this process
alive as a result of my code?

Oddly, even after I quit my program, WINWORD.EXE remains in memory.
However, if after creating my report, viewing it and then manually closing
WORD I check the task manager, it has mysteriously gone. Should I therefore
always call "quit" on the application object model, or will just releasing
the reference to it suffice?

Thanks for any information you can give me.


Robin.
 
You should always call Quit.
Because it's an out of process server, rather than an in-process server,
releasing references will not unload the application, you will need to
explicitly call the quit. Be careful that winword isn't prompting for user
input too, this will cause it to hang and not unload.


message Hi,

I am diligently releasing (Marshal.ReleaseComObject (o) ) all references I
pick up while generating a report using VB.NET in my software. At least, I
*think* I am. However, when I have finished using the WINWORD.EXE com
server, I still have a reference to it hanging somewhere in my code (I know
this because it remains in task manager). I have checked and double checked
but can't find it (although of course I am sure it must be there somewhere).
So my question is: are there any tools or is there any programmatic method I
can use to determine whether or not I have any references to this process
alive as a result of my code?

Oddly, even after I quit my program, WINWORD.EXE remains in memory.
However, if after creating my report, viewing it and then manually closing
WORD I check the task manager, it has mysteriously gone. Should I therefore
always call "quit" on the application object model, or will just releasing
the reference to it suffice?

Thanks for any information you can give me.


Robin.
 
Yes, objWord.Quit for example & then to double-check objWord = Nothing

Obviously, I am using objWord as a variable to explain a point. You should
change it to whatever you've called it
 

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

Back
Top