Automation Error

J

James

Hi,
My users are randomly getting an automation as follows:
Run-time error '-2147417848 (80010108);:
Automation error
The object invoked has disconnected from its clients.

Some users never get this message while others get it at random points
running our templates. Our templates have been in existence for several
years and use a mix of Wordbasic and VBA. The main file new dialog is
created via Wordbasic - I'm not sure if this is connected.

We are running Windows XP / Word 2003 - we've had the problem for (I
think) since upgrading to Word XP.

It is one of those terrible intermittent problems which we cannot
recreate at will, we just have to wait for the phone to ring!

Once the error appears we cannot close Word as there is a second
message about a dialog still being up, so we have to ctrl-alt-delete
and end the process.

Many thanks for any ideas,
James
 
C

Cindy M -WordMVP-

Hi James,

Hard to say, without knowing what the code in the templates is doing in
more detail. If I search this error message from the msdn.microsoft.com
site, I do get a few hits, but none I'd associate with Word,
particularly.

Are you automating anything OTHER than Word? Can you begin to guess, at
all, where in the code it's occurring?

You mention a message about a dialog box needing to be dismissed. Are you
running the application so that it's not visible to the user, then?

My inclination would be to suspect something that's changed, such as a
security message that's been added (SQL when opening a mail merge
document, or a warning that links won't be automatically updated).
My users are randomly getting an automation as follows:
Run-time error '-2147417848 (80010108);:
Automation error
The object invoked has disconnected from its clients.

Some users never get this message while others get it at random points
running our templates. Our templates have been in existence for several
years and use a mix of Wordbasic and VBA. The main file new dialog is
created via Wordbasic - I'm not sure if this is connected.

We are running Windows XP / Word 2003 - we've had the problem for (I
think) since upgrading to Word XP.

It is one of those terrible intermittent problems which we cannot
recreate at will, we just have to wait for the phone to ring!

Once the error appears we cannot close Word as there is a second
message about a dialog still being up, so we have to ctrl-alt-delete
and end the process.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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

Alan Mok

Hi,

I have the same problem. I had a macro which works without error on Word
2000. However, when I try to run it on both Word XP and 2003. I got the same
error. This seems to do with the saving as if I increase the time interval of
saving, the problem comes up later. Also, this problem behaves so randomly, I
can never find out when will that come up.
 
T

Tony Jollans

As Cindy said to James, it is very hard to say what might cause this without
seeing some code. There have been changes made to Automation so that code
which you 'got away with' in earlier releases may not work any more. Really,
for more help you need to google or post some code.
 
A

Alan Mok

Thanks for replying,

Here are the lines that cause the error.
Selection.Paragraphs(1).LineSpacingRule = 4
Selection.Paragraphs(1).LineSpacing = Val(rowheight$)
Selection.TypeText Text:=Temp$
Selection.Font.Reset
As I said, they run ok for n times, then suddenly cause the error.

Many thanks
 
J

James

Many thanks for the replies. My code is a bit too extensive to post and
it can arise at so many random points that I wouldn't know which bit to
post. I have found that replacing my normal.dot seems to help in the
short term, but the error eventually comes back.

James
 
T

Tony Jollans

Hi Alan,

I don't see any connection there with saving.

I also don't see any code that I would expect to trigger this error (but
that doesn't mean it doesn't) - I expect some sort of automation to be
involved.. Can you not pinpoint the line precisely? And, if not, what makes
you think it's in the lines you posted?
 
A

Alan Mok

Hi All,

The reason I mention saving is because if I reduce the save frequency in my
macro, the error seems to come up later. I am not expecting to see this error
message neither from these 3 lines of code. However, this is where it stops
when VBA throws the exception. Moreover, when I try to run these lines after
the exception, it failed and said the paragraph object can not be found!

Many thanks
 
T

Tony Jollans

I can't see anything in that code that would come close to causing this type
of error - of course, that code may be the innocent victim of some other
problem. In theory it shouldn't cause a problem but I have had my suspicions
for a while about using WordBasic in Word 2003 - does your code use it?

Failure to find a paragraph in a Word Selection is not possible (in theory)
suggesting, perhaps, some form of corruption somewhere - but I don't know
what may cause it - I'm sorry.
 
J

James

In my case I suspect the use of Wordbasic in Word 2003. The problem I
have is that other than this problem the templates work fine so it is
hard to find the motivation to do the conversion.

James
 
C

Cindy M -WordMVP-

Hi alan,
Here are the lines that cause the error.
Selection.Paragraphs(1).LineSpacingRule = 4
Selection.Paragraphs(1).LineSpacing = Val(rowheight$)
Selection.TypeText Text:=Temp$
Selection.Font.Reset
As I said, they run ok for n times, then suddenly cause the error.
OK, I'm hoping I've kept proper track of Alan vs. James. It's a bit
confusing :)

Could the problem in your case perhaps stem from Val(rowheight$)? You
might incorporate some code to right questionable values to a text file
(log file) with a time stamp. That way you might be able to track down
what's causing the problem.

If you're also getting the "open dialog box" message, I wonder if it
could be something along the lines that the value for line spacing (for
example) is invalid.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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

Cindy M -WordMVP-

<[email protected]>
<#[email protected]>
<[email protected]>

<[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
Newsgroups: microsoft.public.word.vba.general
NNTP-Posting-Host: 40.165.78.83.cust.bluewin.ch 83.78.165.40
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.word.vba.general:79670

Hi James,
In my case I suspect the use of Wordbasic in Word 2003. The problem I
have is that other than this problem the templates work fine so it is
hard to find the motivation to do the conversion.
As with Alan, it might be worthwhile to write some values to a log
file, so that you can see if there are any common denominators.

In the case of WordBasic it's quite possible your getting/trying to use
values that a later version of Word is having trouble "swallowing".

In both cases I can imagine (although I've never actually seen it) that
Word might be running into issues creating scratch/undo files based on
the WordBasic stuff. Both hypotheses are "gut feeling", based on 15
years of wrestling with the beast...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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