PC Review


Reply
Thread Tools Rate Thread

Cannot kill a WINWORD.EXE instanciation

 
 
Patrick Penet
Guest
Posts: n/a
 
      30th Aug 2007
Hello Gurus,

I have a workbook which includes a Word document.

When, by VBA, the user quits this workbook, once the
Word document is edited, and returns into my app,
an instance of WINWORD is remaining active in the
tasks manager.

And more, even if the user leaves the application, this
WINWORD.EXE remains active and raises a problem
at the closing of Windows.

Any ideas, APIs, tips or tricks well accepted.
Many thanks.

Patrick



 
Reply With Quote
 
 
 
 
papou
Guest
Posts: n/a
 
      30th Aug 2007
Salut Patrick

This may be a stupid idea, but anyway: you may have Outlook already running
Word (defined as mail editor in Outlook options)?

HTH
Cordially
Pascal (not to be considered as an Excel guru!)

"Patrick Penet" <(E-Mail Removed)> a écrit dans le message de
news: 46d6a051$0$21142$(E-Mail Removed)...
> Hello Gurus,
>
> I have a workbook which includes a Word document.
>
> When, by VBA, the user quits this workbook, once the
> Word document is edited, and returns into my app,
> an instance of WINWORD is remaining active in the
> tasks manager.
>
> And more, even if the user leaves the application, this
> WINWORD.EXE remains active and raises a problem
> at the closing of Windows.
>
> Any ideas, APIs, tips or tricks well accepted.
> Many thanks.
>
> Patrick
>
>
>



 
Reply With Quote
 
=?Utf-8?B?SGFsaW0=?=
Guest
Posts: n/a
 
      30th Aug 2007
hi,

You have to define your WORD object variable as a public variable

Public WordObj as Object

Sub Initial()
Set WordObj = createobject("word.application")
WordObj.visible = true
'do your stuff here...
End sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
WordObj.Quit
set WordObj = nothing
End Sub

--
Regards,

Halim



"Patrick Penet" wrote:

> Hello Gurus,
>
> I have a workbook which includes a Word document.
>
> When, by VBA, the user quits this workbook, once the
> Word document is edited, and returns into my app,
> an instance of WINWORD is remaining active in the
> tasks manager.
>
> And more, even if the user leaves the application, this
> WINWORD.EXE remains active and raises a problem
> at the closing of Windows.
>
> Any ideas, APIs, tips or tricks well accepted.
> Many thanks.
>
> Patrick

 
Reply With Quote
 
Patrick Penet
Guest
Posts: n/a
 
      30th Aug 2007
>you may have Outlook already running Word (defined as mail editor in Outlook options ?

No, this is not the case.
Merci, anyway.
;-)
Patrick

"papou" <cpapoupasbon@çanonpluslaposte.net> a écrit dans le message de news: eEw1%(E-Mail Removed)...
> Salut Patrick
>
> This may be a stupid idea, but anyway: you may have Outlook already running Word (defined as mail editor in Outlook options)?
>
> HTH
> Cordially
> Pascal (not to be considered as an Excel guru!)
>
> "Patrick Penet" <(E-Mail Removed)> a écrit dans le message de news:
> 46d6a051$0$21142$(E-Mail Removed)...
>> Hello Gurus,
>>
>> I have a workbook which includes a Word document.
>>
>> When, by VBA, the user quits this workbook, once the
>> Word document is edited, and returns into my app,
>> an instance of WINWORD is remaining active in the
>> tasks manager.
>>
>> And more, even if the user leaves the application, this
>> WINWORD.EXE remains active and raises a problem
>> at the closing of Windows.
>>
>> Any ideas, APIs, tips or tricks well accepted.
>> Many thanks.
>>
>> Patrick
>>
>>
>>

>
>



 
Reply With Quote
 
Patrick Penet
Guest
Posts: n/a
 
      30th Aug 2007
Thank you but I need further precisions.

The Word document is inbedded in a workbook
and programmatically I do not intent to act on it.

The user only opens the WB and modifies the
document if he needs and then closes the WB.

The WB is in another instance of Excel and saved
in the Before_Close sub.

Both the WB and the document have small pieces
of code mainly for design and behaviour.

So, at your idea, where should I put the code you
suggested ?

Thank you for answering.
Patrick

"Halim" <(E-Mail Removed)> a écrit dans le message de news: 0412F897-F66A-41D7-8310-(E-Mail Removed)...
> hi,
>
> You have to define your WORD object variable as a public variable
>
> Public WordObj as Object
>
> Sub Initial()
> Set WordObj = createobject("word.application")
> WordObj.visible = true
> 'do your stuff here...
> End sub
>
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
> WordObj.Quit
> set WordObj = nothing
> End Sub
>
> --
> Regards,
>
> Halim
>
>
>
> "Patrick Penet" wrote:
>
>> Hello Gurus,
>>
>> I have a workbook which includes a Word document.
>>
>> When, by VBA, the user quits this workbook, once the
>> Word document is edited, and returns into my app,
>> an instance of WINWORD is remaining active in the
>> tasks manager.
>>
>> And more, even if the user leaves the application, this
>> WINWORD.EXE remains active and raises a problem
>> at the closing of Windows.
>>
>> Any ideas, APIs, tips or tricks well accepted.
>> Many thanks.
>>
>> Patrick



 
Reply With Quote
 
=?Utf-8?B?SGFsaW0=?=
Guest
Posts: n/a
 
      31st Aug 2007
Place this code below in a standard module:
code below will open word better if you run 'Initial' once at first.
Public WordObj as Object
Sub Initial()
Set WordObj = createobject("word.application")
WordObj.visible = true
'do your stuff here...
End sub

Then place code below in ThisWorkbook module:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
WordObj.Quit
set WordObj = nothing
End Sub

--
Regards,

Halim



"Patrick Penet" wrote:

> Thank you but I need further precisions.
>
> The Word document is inbedded in a workbook
> and programmatically I do not intent to act on it.
>
> The user only opens the WB and modifies the
> document if he needs and then closes the WB.
>
> The WB is in another instance of Excel and saved
> in the Before_Close sub.
>
> Both the WB and the document have small pieces
> of code mainly for design and behaviour.
>
> So, at your idea, where should I put the code you
> suggested ?
>
> Thank you for answering.
> Patrick
>
> "Halim" <(E-Mail Removed)> a écrit dans le message de news: 0412F897-F66A-41D7-8310-(E-Mail Removed)...
> > hi,
> >
> > You have to define your WORD object variable as a public variable
> >
> > Public WordObj as Object
> >
> > Sub Initial()
> > Set WordObj = createobject("word.application")
> > WordObj.visible = true
> > 'do your stuff here...
> > End sub
> >
> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
> > WordObj.Quit
> > set WordObj = nothing
> > End Sub
> >
> > --
> > Regards,
> >
> > Halim
> >
> >
> >
> > "Patrick Penet" wrote:
> >
> >> Hello Gurus,
> >>
> >> I have a workbook which includes a Word document.
> >>
> >> When, by VBA, the user quits this workbook, once the
> >> Word document is edited, and returns into my app,
> >> an instance of WINWORD is remaining active in the
> >> tasks manager.
> >>
> >> And more, even if the user leaves the application, this
> >> WINWORD.EXE remains active and raises a problem
> >> at the closing of Windows.
> >>
> >> Any ideas, APIs, tips or tricks well accepted.
> >> Many thanks.
> >>
> >> Patrick

>
>
>

 
Reply With Quote
 
Patrick Penet
Guest
Posts: n/a
 
      1st Sep 2007
Sorry Halim it does not work.
Actually this code is opening a new instance of Word
but not the one wich is embedded in XL.

The problem is : if the user needs to modify the
text of the embedded Word, he first select the
Word object (right click) and then double click
on it.

This will open an instance of Word "inside" Excel.

This is this instance that would not terminate when
closing the workbook.

Thanks anyhow.

Patrick

"Halim" <(E-Mail Removed)> a écrit dans le message de news: 2220FAFA-27E2-454F-A0F0-(E-Mail Removed)...
> Place this code below in a standard module:
> code below will open word better if you run 'Initial' once at first.
> Public WordObj as Object
> Sub Initial()
> Set WordObj = createobject("word.application")
> WordObj.visible = true
> 'do your stuff here...
> End sub
>
> Then place code below in ThisWorkbook module:
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
> WordObj.Quit
> set WordObj = nothing
> End Sub
>
> --
> Regards,
>
> Halim
>
>
>
> "Patrick Penet" wrote:
>
>> Thank you but I need further precisions.
>>
>> The Word document is inbedded in a workbook
>> and programmatically I do not intent to act on it.
>>
>> The user only opens the WB and modifies the
>> document if he needs and then closes the WB.
>>
>> The WB is in another instance of Excel and saved
>> in the Before_Close sub.
>>
>> Both the WB and the document have small pieces
>> of code mainly for design and behaviour.
>>
>> So, at your idea, where should I put the code you
>> suggested ?
>>
>> Thank you for answering.
>> Patrick
>>
>> "Halim" <(E-Mail Removed)> a écrit dans le message de news: 0412F897-F66A-41D7-8310-(E-Mail Removed)...
>> > hi,
>> >
>> > You have to define your WORD object variable as a public variable
>> >
>> > Public WordObj as Object
>> >
>> > Sub Initial()
>> > Set WordObj = createobject("word.application")
>> > WordObj.visible = true
>> > 'do your stuff here...
>> > End sub
>> >
>> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
>> > WordObj.Quit
>> > set WordObj = nothing
>> > End Sub
>> >
>> > --
>> > Regards,
>> >
>> > Halim
>> >
>> >
>> >
>> > "Patrick Penet" wrote:
>> >
>> >> Hello Gurus,
>> >>
>> >> I have a workbook which includes a Word document.
>> >>
>> >> When, by VBA, the user quits this workbook, once the
>> >> Word document is edited, and returns into my app,
>> >> an instance of WINWORD is remaining active in the
>> >> tasks manager.
>> >>
>> >> And more, even if the user leaves the application, this
>> >> WINWORD.EXE remains active and raises a problem
>> >> at the closing of Windows.
>> >>
>> >> Any ideas, APIs, tips or tricks well accepted.
>> >> Many thanks.
>> >>
>> >> Patrick

>>
>>
>>



 
Reply With Quote
 
papou
Guest
Posts: n/a
 
      3rd Sep 2007
Salut Patrick
Have a look at this and see if it helps:
http://www.vbfrance.com/codes/LISTER...-API_4422.aspx

HTH
Cordially
Pascal

"Patrick Penet" <(E-Mail Removed)> a écrit dans le message de
news: 46d931c3$0$21147$(E-Mail Removed)...
> Sorry Halim it does not work.
> Actually this code is opening a new instance of Word
> but not the one wich is embedded in XL.
>
> The problem is : if the user needs to modify the
> text of the embedded Word, he first select the
> Word object (right click) and then double click
> on it.
>
> This will open an instance of Word "inside" Excel.
>
> This is this instance that would not terminate when
> closing the workbook.
>
> Thanks anyhow.
>
> Patrick
>
> "Halim" <(E-Mail Removed)> a écrit dans le message de news:
> 2220FAFA-27E2-454F-A0F0-(E-Mail Removed)...
>> Place this code below in a standard module:
>> code below will open word better if you run 'Initial' once at first.
>> Public WordObj as Object
>> Sub Initial()
>> Set WordObj = createobject("word.application")
>> WordObj.visible = true
>> 'do your stuff here...
>> End sub
>>
>> Then place code below in ThisWorkbook module:
>> Private Sub Workbook_BeforeClose(Cancel As Boolean)
>> WordObj.Quit
>> set WordObj = nothing
>> End Sub
>>
>> --
>> Regards,
>>
>> Halim
>>
>>
>>
>> "Patrick Penet" wrote:
>>
>>> Thank you but I need further precisions.
>>>
>>> The Word document is inbedded in a workbook
>>> and programmatically I do not intent to act on it.
>>>
>>> The user only opens the WB and modifies the
>>> document if he needs and then closes the WB.
>>>
>>> The WB is in another instance of Excel and saved
>>> in the Before_Close sub.
>>>
>>> Both the WB and the document have small pieces
>>> of code mainly for design and behaviour.
>>>
>>> So, at your idea, where should I put the code you
>>> suggested ?
>>>
>>> Thank you for answering.
>>> Patrick
>>>
>>> "Halim" <(E-Mail Removed)> a écrit dans le message de
>>> news: 0412F897-F66A-41D7-8310-(E-Mail Removed)...
>>> > hi,
>>> >
>>> > You have to define your WORD object variable as a public variable
>>> >
>>> > Public WordObj as Object
>>> >
>>> > Sub Initial()
>>> > Set WordObj = createobject("word.application")
>>> > WordObj.visible = true
>>> > 'do your stuff here...
>>> > End sub
>>> >
>>> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
>>> > WordObj.Quit
>>> > set WordObj = nothing
>>> > End Sub
>>> >
>>> > --
>>> > Regards,
>>> >
>>> > Halim
>>> >
>>> >
>>> >
>>> > "Patrick Penet" wrote:
>>> >
>>> >> Hello Gurus,
>>> >>
>>> >> I have a workbook which includes a Word document.
>>> >>
>>> >> When, by VBA, the user quits this workbook, once the
>>> >> Word document is edited, and returns into my app,
>>> >> an instance of WINWORD is remaining active in the
>>> >> tasks manager.
>>> >>
>>> >> And more, even if the user leaves the application, this
>>> >> WINWORD.EXE remains active and raises a problem
>>> >> at the closing of Windows.
>>> >>
>>> >> Any ideas, APIs, tips or tricks well accepted.
>>> >> Many thanks.
>>> >>
>>> >> Patrick
>>>
>>>
>>>

>
>



 
Reply With Quote
 
Patrick Penet
Guest
Posts: n/a
 
      4th Sep 2007
Merci Papou, ça marche !
@ +
Patrick


"papou" <cpapoupasbon@çanonpluslaposte.net> a écrit dans le message de news: (E-Mail Removed)...
> Salut Patrick
> Have a look at this and see if it helps:
> http://www.vbfrance.com/codes/LISTER...-API_4422.aspx
>
> HTH
> Cordially
> Pascal
>
> "Patrick Penet" <(E-Mail Removed)> a écrit dans le message de news:
> 46d931c3$0$21147$(E-Mail Removed)...
>> Sorry Halim it does not work.
>> Actually this code is opening a new instance of Word
>> but not the one wich is embedded in XL.
>>
>> The problem is : if the user needs to modify the
>> text of the embedded Word, he first select the
>> Word object (right click) and then double click
>> on it.
>>
>> This will open an instance of Word "inside" Excel.
>>
>> This is this instance that would not terminate when
>> closing the workbook.
>>
>> Thanks anyhow.
>>
>> Patrick
>>
>> "Halim" <(E-Mail Removed)> a écrit dans le message de news: 2220FAFA-27E2-454F-A0F0-(E-Mail Removed)...
>>> Place this code below in a standard module:
>>> code below will open word better if you run 'Initial' once at first.
>>> Public WordObj as Object
>>> Sub Initial()
>>> Set WordObj = createobject("word.application")
>>> WordObj.visible = true
>>> 'do your stuff here...
>>> End sub
>>>
>>> Then place code below in ThisWorkbook module:
>>> Private Sub Workbook_BeforeClose(Cancel As Boolean)
>>> WordObj.Quit
>>> set WordObj = nothing
>>> End Sub
>>>
>>> --
>>> Regards,
>>>
>>> Halim
>>>
>>>
>>>
>>> "Patrick Penet" wrote:
>>>
>>>> Thank you but I need further precisions.
>>>>
>>>> The Word document is inbedded in a workbook
>>>> and programmatically I do not intent to act on it.
>>>>
>>>> The user only opens the WB and modifies the
>>>> document if he needs and then closes the WB.
>>>>
>>>> The WB is in another instance of Excel and saved
>>>> in the Before_Close sub.
>>>>
>>>> Both the WB and the document have small pieces
>>>> of code mainly for design and behaviour.
>>>>
>>>> So, at your idea, where should I put the code you
>>>> suggested ?
>>>>
>>>> Thank you for answering.
>>>> Patrick
>>>>
>>>> "Halim" <(E-Mail Removed)> a écrit dans le message de news:
>>>> 0412F897-F66A-41D7-8310-(E-Mail Removed)...
>>>> > hi,
>>>> >
>>>> > You have to define your WORD object variable as a public variable
>>>> >
>>>> > Public WordObj as Object
>>>> >
>>>> > Sub Initial()
>>>> > Set WordObj = createobject("word.application")
>>>> > WordObj.visible = true
>>>> > 'do your stuff here...
>>>> > End sub
>>>> >
>>>> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
>>>> > WordObj.Quit
>>>> > set WordObj = nothing
>>>> > End Sub
>>>> >
>>>> > --
>>>> > Regards,
>>>> >
>>>> > Halim
>>>> >
>>>> >
>>>> >
>>>> > "Patrick Penet" wrote:
>>>> >
>>>> >> Hello Gurus,
>>>> >>
>>>> >> I have a workbook which includes a Word document.
>>>> >>
>>>> >> When, by VBA, the user quits this workbook, once the
>>>> >> Word document is edited, and returns into my app,
>>>> >> an instance of WINWORD is remaining active in the
>>>> >> tasks manager.
>>>> >>
>>>> >> And more, even if the user leaves the application, this
>>>> >> WINWORD.EXE remains active and raises a problem
>>>> >> at the closing of Windows.
>>>> >>
>>>> >> Any ideas, APIs, tips or tricks well accepted.
>>>> >> Many thanks.
>>>> >>
>>>> >> Patrick
>>>>
>>>>
>>>>

>>
>>

>
>



 
Reply With Quote
 
Joe Law
Guest
Posts: n/a
 
      12th Mar 2008
Here is a windows service that will kill all run away WINWORD.EXE after
a configurable amount of time.

http://www.spikesolutions.net/ViewSo...9-24e0-4942-8a
c4-2f78eda45469

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Kill the WinWord SpellChecker process I started? Dean Slindee Microsoft VB .NET 2 10th Nov 2008 02:07 AM
File saved with newest WinWord won't open in WinWord 2000 Norman Swartz Microsoft Word Document Management 1 15th Mar 2008 09:36 PM
Winword 2007 crashes on the following command line: winword aaa.do Michael Microsoft Word Document Management 2 6th Feb 2008 01:35 PM
Cannot kill a WINWORD.EXE instanciation - Sorry for reposting ... Patrick Penet Microsoft Excel Programming 8 4th Sep 2007 10:11 AM
how to correct winword has caused an error in winword.exe =?Utf-8?B?c2luZ2VyMQ==?= Microsoft Word Document Management 0 12th Jan 2005 09:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 PM.