I want to know whether WINWORD.EXE
is running when I open a Word document embedded in Excel. If it is not already running then I want to use objWord.Quit
. It's possible the user is working in Word and I don't want to interfere with that, so in that case objWord.Quit should not be executed.
I have this -sniped- code:
'Variable declaration
Dim objWord As Word.Application
Dim objDoc As Word.Document
objWord
is being instantiated like this:
ActiveSheet.OLEObjects(P).Activate
Set objWord = GetObject(, "Word.Application")
At end of the procedure:
Set objDoc = Nothing
Set objWord = Nothing
But the WINWORD.EXE
instance remains running.
How can I determine whether WINWORD.EXE
Is running when the procedure begins?