When a user starts Word manually, they activate the instance of Word that you previously created using CreateObject, instead of opening a new instance
Article contributed by Dave Rado
If you start an instance of Word using CreateObject, and don't make it visible, and if a user subsequently starts Word manually, they will activate the instance of Word you created programmatically, instead of opening a new instance. However, if you make Word visible immediately after creating the object, you don't get the problem.
The workaround (assuming you don't want to make Word visible) is to create a temporary Word object, then create the “real” one, then close the temporary object. This is also covered in Microsoft Knowledge Base article Q188546, which includes the following code sample:
Private Sub
CreateWordObject()
Dim TempApp As Word.Application, wrdApp
As Word.Application
'Test if object is already created before calling
CreateObject:
If TypeName(wrdApp) <>
"Application"
Then
'Create temporary Word object
Set TempApp =
CreateObject("Word.Application")
'Create "real" Word object
Set wrdApp =
CreateObject("Word.Application")
'Close temporary Word object
TempApp.Quit
Set TempApp = Nothing
End If
End Sub