"Object disconnected from clients"??

E

Ed

In an Excel macro, I call Word and open a document which has an Auto_Open
macro. I've done it before with no problems. Today, though, the macro runs
through:
doc = "C:\Documents and
Settings\username\Desktop\folder\TablesTemplate.doc"
Set WD = CreateObject("Word.Application")
WD.Documents.Open doc
WD.Visible = True

and, on the last line, gives the following error message:
Run-time Error '-2147417848(80010180)':
Automation Error
The object involved has disconnected from its clients.

Any suggestions?

Ed
 
C

Cindy M -WordMVP-

Hi Ed,

Unfortunately, you don't mention which version of Office you're using... Did
you search the Knowleged Base on the microsoft website to see if any of the
articles there cover your situation? Have you tried re-booting Windows to see
if the behavior persists? Are you able to open this document directly, through
the Word UI?
In an Excel macro, I call Word and open a document which has an Auto_Open
macro. I've done it before with no problems. Today, though, the macro runs
through:
doc = "C:\Documents and
Settings\username\Desktop\folder\TablesTemplate.doc"
Set WD = CreateObject("Word.Application")
WD.Documents.Open doc
WD.Visible = True

and, on the last line, gives the following error message:
Run-time Error '-2147417848(80010180)':
Automation Error
The object involved has disconnected from its clients.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
E

Ed

Thanks for responding, Cindy. I'm using Office 2000 on Windows 2000. I did
try a reboot, but it didn't work. And I was able to open the doc through
Word. What I wound up doing was just deleting the Visible line entirely.
The doc has an Auto_Open macro that runs when the Excel code opens it, and
the Excel code has some more lines to finish out. The doc still opens and
everything still works okay - I just can't see it because it's not made
visible. Oh, well.

Ed
 
C

Cindy M -WordMVP-

Hi Ed,
I'm using Office 2000 on Windows 2000. I did
try a reboot, but it didn't work. And I was able to open the doc through
Word. What I wound up doing was just deleting the Visible line entirely.
The doc has an Auto_Open macro that runs when the Excel code opens it, and
the Excel code has some more lines to finish out. The doc still opens and
everything still works okay - I just can't see it because it's not made
visible. Oh, well.
Very odd... A couple of remarks, although I'm not sure they'll lead us
anywhere useful:

1. You don't show how you declare the WD object variable. There could be
something with that, perhaps.

2. You might try the NEW keyword instead of CreateObject, just to see if
that interface makes any difference

3. You might try WD.Activate (instead of, before and after) WD.Visible =
True to see if that gives any different result.

4. I surely hope the macro running in the Word document is named AutoOpen
(no underline) :)

5. Is there any network stuff involved, here?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

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