473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

References to WINWORD.EXE still alive.

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.
Nov 21 '05 #1
2 4191
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.
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:cs*******************@news.demon.co.uk...
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.

Nov 21 '05 #2
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

"Lance Wynn" wrote:
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.
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:cs*******************@news.demon.co.uk...
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.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike MacSween | last post by:
I've done an Access app that does some Word automation. The code is long but the meat of it is: Sub testword() Dim wrdapp As Word.Application Set wrdapp = New Word.Application wrdapp.Visible =...
0
by: Just D. | last post by:
Guys, I'm writing the Windows Application and one of the ideas is to use a RichText field to store/show some formatted text, probably with pictures. The problem is that this RichEdit control is...
3
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
2
by: Matthew Herrmann | last post by:
Hi, I've heard from groups that listeners to event handlers cause references to be kept alive, if the targets are marked to stay alive. I need to make sure that attaching events to objects will...
2
by: MikeP | last post by:
Hi there, This is actually (probably) a C# or .NET issue. I'm working on an VS 2005 AddIn and at one point I'm caching all "EnvDTE80.ErrorItem" objects that result from compiling one or more...
1
by: tvjraman | last post by:
Visual Basic 6 I use Getobject() to get the object of Word application. I always get the first instance of Winword.exe I have a macro in another instance of Winword.exe I need to get the...
0
by: richard.krehbiel | last post by:
I've been googling for half a day now and have found answers on both sides of the argument. Baiscally it's this: I am using PHP 5.0.4 (I can upgrade if that's a solution) as an ISAPI module under...
2
by: Dean Slindee | last post by:
Using this statement to utilize the spell checker in WinWord: WinOffice.clsWord.SpellChecker(txtNote.Text) 'this does not work because no main window is displayed 'Dim proc =...
2
ajester
by: ajester | last post by:
I need WinWord to look like it's being executed from the correct path: C:\Program Files\Microsoft Office\Office12\WinWord.exe when in reality it's being launch from a Java app using the path...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.