Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to kill orphaned process in word application using vb.net

Posted on 2004-04-19
7
Medium Priority
?
365 Views
Last Modified: 2007-12-19
I am using a Vb.net application to automate the word Aplication. I
call Application.Quit() and set the object to Nothing but word.Exe is still
running in my task manager. Anyone know how to make it go away.
0
Comment
Question by:satyaprakash47
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Expert Comment

by:zulu_11
ID: 10865717
Hi,

Before you quit the application, be sure to close all the documents that you have opened..
Document.Close();

I'll be able to tell much better if you could post your code here..

Zulu
0
 
LVL 5

Expert Comment

by:tgannetts
ID: 10866896
I have a similar problem with Excel Automation, in that even if I have closed all spreadsheets etc the process is still running. I therefore had to use the following sub which I have modifed for your Word problem:

Public Sub Kill_Word()

        Dim procs As Process() = Process.GetProcessesByName("WINWORD")
        Dim proc As Process

        For Each proc In procs
            If proc.Responding Then
                If proc.MainWindowTitle = "" Then
                    proc.Kill()
                End If
            Else
                proc.Kill()
            End If
        Next proc

End Sub

Tom.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 200 total points
ID: 10870671
Also try using System.Runtime.InteropServices.Marshal.ReleaseComObject on each object that you have declared (Workbook, Worksheet, Document, Application, etc.)

Bob
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10870678
Another thing is to force garbage collection:

GC.Collect()

Bob
0
 
LVL 2

Expert Comment

by:UncleMidriff
ID: 12655679
I just wanted to thank tgannetts for his comment in this thread, as it is just what I was looking for.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question