S
sympatico
Hi
This is what I have done. I created a form and put on button on it and
added a reference to Word Object library.
Private Sub Command1_Click()
MsgBox (Word.Application.Documents.Count)
End Sub
When I execute it, I open up several documents and I then click the button
it gives me the accurate count. When I close all those word documents and
open up 1 document. My code errors out.
Runtime error '462'
Remote server or machine is unavailable.
It's as if once I first open up word, my program will reference it, but if I
close that instance of word and open a new one, the program can no longer
reference it, I use the createObject("Word.application") but that gives me
a new instance of the word application object instead of working with the
one that already exists.
Can some one help please? Thanks
This is what I have done. I created a form and put on button on it and
added a reference to Word Object library.
Private Sub Command1_Click()
MsgBox (Word.Application.Documents.Count)
End Sub
When I execute it, I open up several documents and I then click the button
it gives me the accurate count. When I close all those word documents and
open up 1 document. My code errors out.
Runtime error '462'
Remote server or machine is unavailable.
It's as if once I first open up word, my program will reference it, but if I
close that instance of word and open a new one, the program can no longer
reference it, I use the createObject("Word.application") but that gives me
a new instance of the word application object instead of working with the
one that already exists.
Can some one help please? Thanks