run-time error -2147417848 (80010108)

J

jairoscz

I have a VBA script (macro) that opens all the documents in a
directory, one at a time, and whilst the document is open, it scans the
text in it and extracts text that has a border around it. The script
also opens an excel workbook with a list of over 6000 strings and
stores all these in an array in VBA. The script then closes the excel
workbook. The strings extracted from the word document are then
compared against the list that was on the excel workbook (now in the
array).

Anyway, as the script is running sometimes sooner, sometimes later, I
get this "run-time error -2147417848 (80010108)" and I have noooooo
idea what is causing it! I find reference to this error in the
microsoft website but none that applies to my problem. If ANYBODY has
any idea what is going could you please help!!!


Thank you!

-
Jairo
 
C

Cindy M -WordMVP-

Anyway, as the script is running sometimes sooner, sometimes later, I
get this "run-time error -2147417848 (80010108)" and I have noooooo
idea what is causing it! I find reference to this error in the
microsoft website but none that applies to my problem.
A search of the MSDN site didn't turn anything up, for me. Do you have
a URL or more for the information you did find?
I have a VBA script (macro)
In which application is this script running?

Please describe the actions of the code you're using. It would also
help to see the code, with the line marked that's causing the error.

Finally, which version of Office is involved?

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 :)
 
M

Mike Stephenson

According to the ErrorLookup utility from Visual Studio, this error is:
"The object invoked has disconnected from its clients. "

This is a COM/Automation error. In general terms it means that the COM object
(server) you are trying to automate (probably Excel) has probably shut down.

When you say "close the workbook", do you mean that you are actually telling
Excel to quit? I'm not sure if VBScript has a Set object = Nothing type of
statement like VB/VBA, but I believe that would also release the Excel object
and it would quit.

It sounds to me like something is trying to access Excel after you have "closed
the workbook". Without seeing your script, it's hard to tell.

As a note, rather than automating Excel just to get a list of strings, you might
want to store them in a text file and use regular file access functions to read
the strings into an array (in VB/VBA, you could read the entire file into a
single String variable and then do a split on vbCRLF to create your array with
just a couple of lines of code), or you could use ADO to read the Excel
spreadsheet file as if it was a database (very easy to do, just get the
connection string correct, and then each worksheet in the workbook represents a
table in the virtual database, no Excel required).
 

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