Instance of word application stay alive after program termination

K

kauf

Hi,
One problem with MSWord 2003 automation.
Instance of word application stay alive after program termination.

I wrote simple test application (VB6):

---------------------------------------
Dim oWordApp As Word.Application
With oWordApp
Dim oWordDoc As Word.Document
Set oWordDoc = .Documents.Add
End With

With oWordDoc
.Content.Text = "Hello, World!"
.SaveAs "Hello"
.Close
End With

Set oWordDoc = Nothing
oWordApp.Quit
Set oWordApp = Nothing
---------------------------------------

Step to reproduce:
Open new word application manualy.
Execute code above.
Open task manager --> two instances of WINWORD are there.

I try to reproduce with behaviour on diferent PC with same OS an
MSWord version
It reproduced on 50% of PC
I just can't explain this..
 
C

Cindy M -WordMVP-

Hi Kauf,
One problem with MSWord 2003 automation.
Instance of word application stay alive after program termination.

I wrote simple test application (VB6):
You don't show us how you're SETting the oWordApp object variable,
which makes it difficult to troubleshoot.

Also, is Outlook perhaps running when this happens, with Word set as
the Email editor?
---------------------------------------
Dim oWordApp As Word.Application
With oWordApp
Dim oWordDoc As Word.Document
Set oWordDoc = .Documents.Add
End With

With oWordDoc
.Content.Text = "Hello, World!"
.SaveAs "Hello"
.Close
End With

Set oWordDoc = Nothing
oWordApp.Quit
Set oWordApp = Nothing
---------------------------------------

Step to reproduce:
Open new word application manualy.
Execute code above.
Open task manager --> two instances of WINWORD are there.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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