By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

Strange Automation Issue

P: n/a
I have a strange situation with my Access 2000 database. I have code in the
database which has worked fine for years, and now all of a sudden doesn't
work fine on one or two of my client's machines. The code opens MS Word
through Automation and then opens a particular Word doc. It's still working
fine on most machines; but on one or two of them, the user is getting an
Automation Error. The code used is as follows:

Dim objWord As Word.Application
Set objWord = New Word.Application
objWord.Documents.Open FileName:=strFilename, _
ConfirmConversions:=False, _
ReadOnly:=False, _
AddToRecentFiles:=False, _
Revert:=False, _
Format:=gcon_wdOpenFormatAuto 'this is global constant with
Word constant value

The Automation Error occurs on the third line, when trying to open the
document (the document does exist, so that's not the problem).

Even stranger than the fact that the problem's only happening on two out of
several dozen machines, is the following. I have a pared-down copy of the
database, that users use to take on the road with them and show to clients.
The pared-down version (call it "App B") was taken from the original (call
it "App A") with some functionality removed. Regarding the above code that's
failing, both App A and App B are identical, and both have the same
references.

Now, here's the really strange part.

On one computer that's having problems, App A fails in the above code. On
the other computer that's having problems, App A works fine in the above
code, but App B fails in that code. So, in the second case, with the same
computer and two identical sets of code, one set fails, the other doesn't.

I've looked at backup copies to see if it was a corruption issue, and
haven't seen any difference. And, as noted, this code has been in place for
years without problems, until just the other day when these problems started
happening.

All of the users have MS Office and the database application installed on
their C drives.

Any assistance would be appreciated.

Thanks!

Neil
Nov 12 '05 #1
Share this Question
Share on Google+
25 Replies


P: n/a
> the user is getting an Automation Error.

Neil

I don't know if this might help pinpoint the problem.

Have you written an error handler to display the
automation error using the vbObjectError constant?

If you need it, the following information relates to the
vbObjectError constant:

1. Subtracting vbObjectError from Err.Number will
indicate the error as defined by the server application.

2. However, if subtracting vbObjectError from Err.Number
results in a number outside the range 0 - 65535, the
error is a VBA error.

Therefore, your error handler might look like:

' Remove the constant added by the server application:
MyError = Err.Number - vbObjectError

' Is the result in the range 0 - 65535?
If MyError > 0 and MyError < 65535 then

Msg = "The object you accessed assigned this number to " & _
"the error: " & MyError & ". The originator of " & _
"the error was: " & Err.Source & ". Press F1 to " & _
"see the originating applications' help topic."

Else ' It's a VBA error:

Msg = "This error " & Err.Number & " is a VBA error. " & _
"Press Help button or F1 for VBA Help topic on " & _
"this error."

End if

Msgbox Msg, , "Object Error", Err.Helpfile, Err.HelpContext
Obviously, this doesn't solve your problem, but it may
help you identify it.

HTH
Geoff
Nov 12 '05 #2

P: n/a
TC
*What* automation error?

TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:5t*****************@newsread3.news.pas.earthl ink.net...
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't
work fine on one or two of my client's machines. The code opens MS Word
through Automation and then opens a particular Word doc. It's still working fine on most machines; but on one or two of them, the user is getting an
Automation Error. The code used is as follows:

Dim objWord As Word.Application
Set objWord = New Word.Application
objWord.Documents.Open FileName:=strFilename, _
ConfirmConversions:=False, _
ReadOnly:=False, _
AddToRecentFiles:=False, _
Revert:=False, _
Format:=gcon_wdOpenFormatAuto 'this is global constant with
Word constant value

The Automation Error occurs on the third line, when trying to open the
document (the document does exist, so that's not the problem).

Even stranger than the fact that the problem's only happening on two out of several dozen machines, is the following. I have a pared-down copy of the
database, that users use to take on the road with them and show to clients. The pared-down version (call it "App B") was taken from the original (call
it "App A") with some functionality removed. Regarding the above code that's failing, both App A and App B are identical, and both have the same
references.

Now, here's the really strange part.

On one computer that's having problems, App A fails in the above code. On
the other computer that's having problems, App A works fine in the above
code, but App B fails in that code. So, in the second case, with the same
computer and two identical sets of code, one set fails, the other doesn't.

I've looked at backup copies to see if it was a corruption issue, and
haven't seen any difference. And, as noted, this code has been in place for years without problems, until just the other day when these problems started happening.

All of the users have MS Office and the database application installed on
their C drives.

Any assistance would be appreciated.

Thanks!

Neil

Nov 12 '05 #3

P: n/a
"Run-time error '-2147023067 (80070725)': Automation error."

"TC" <a@b.c.d> wrote in message news:1067480554.540605@teuthos...
*What* automation error?

TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:5t*****************@newsread3.news.pas.earthl ink.net...
I have a strange situation with my Access 2000 database. I have code in

the
database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's machines. The code opens MS Word
through Automation and then opens a particular Word doc. It's still

working
fine on most machines; but on one or two of them, the user is getting an
Automation Error. The code used is as follows:

Dim objWord As Word.Application
Set objWord = New Word.Application
objWord.Documents.Open FileName:=strFilename, _
ConfirmConversions:=False, _
ReadOnly:=False, _
AddToRecentFiles:=False, _
Revert:=False, _
Format:=gcon_wdOpenFormatAuto 'this is global constant with
Word constant value

The Automation Error occurs on the third line, when trying to open the
document (the document does exist, so that's not the problem).

Even stranger than the fact that the problem's only happening on two out

of
several dozen machines, is the following. I have a pared-down copy of the database, that users use to take on the road with them and show to

clients.
The pared-down version (call it "App B") was taken from the original (call it "App A") with some functionality removed. Regarding the above code

that's
failing, both App A and App B are identical, and both have the same
references.

Now, here's the really strange part.

On one computer that's having problems, App A fails in the above code. On the other computer that's having problems, App A works fine in the above
code, but App B fails in that code. So, in the second case, with the same computer and two identical sets of code, one set fails, the other doesn't.
I've looked at backup copies to see if it was a corruption issue, and
haven't seen any difference. And, as noted, this code has been in place

for
years without problems, until just the other day when these problems

started
happening.

All of the users have MS Office and the database application installed on their C drives.

Any assistance would be appreciated.

Thanks!

Neil


Nov 12 '05 #4

P: n/a
In my case, Err.Number = -2147023067 and vbObjectError = -2147221504.
Subtracting the second from the first I get 198437, which according to your
notes means it's a VBA error. I'm not sure where that gets me, since the VBA
code hasn't changed years and it started being problematic a couple of days
ago. Any ideas?

Thanks,

Neil
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg1.svr.pol.co.uk...
the user is getting an Automation Error.


Neil

I don't know if this might help pinpoint the problem.

Have you written an error handler to display the
automation error using the vbObjectError constant?

If you need it, the following information relates to the
vbObjectError constant:

1. Subtracting vbObjectError from Err.Number will
indicate the error as defined by the server application.

2. However, if subtracting vbObjectError from Err.Number
results in a number outside the range 0 - 65535, the
error is a VBA error.

Therefore, your error handler might look like:

' Remove the constant added by the server application:
MyError = Err.Number - vbObjectError

' Is the result in the range 0 - 65535?
If MyError > 0 and MyError < 65535 then

Msg = "The object you accessed assigned this number to " & _
"the error: " & MyError & ". The originator of " & _
"the error was: " & Err.Source & ". Press F1 to " & _
"see the originating applications' help topic."

Else ' It's a VBA error:

Msg = "This error " & Err.Number & " is a VBA error. " & _
"Press Help button or F1 for VBA Help topic on " & _
"this error."

End if

Msgbox Msg, , "Object Error", Err.Helpfile, Err.HelpContext
Obviously, this doesn't solve your problem, but it may
help you identify it.

HTH
Geoff

Nov 12 '05 #5

P: n/a
TC
I found a couple of posts about this error: both in German! Here's one,
translated by altavista:

"When responding Word from ACCESS (Office 97) out I have the problem that I
get an automation error from ACCESS. The complete error message reads: Run
time error -2147023067 (80070725) Automasierungfehler Incompatible version
of the RPC Stub The common to the fact is that the program on some computers
does not laeueft and on others. On all computers NT 4,0 with service luggage
6a and Office 97 with SP2 runs. I packed some often needed functions into a
class. In this class Word is initalisiert and assigned as object of a
Membervariablen [ set Word=CreateObject"Word.Application")..]. If the Word
object to access, hails it is now tried above error message e.g.
oWord.ChangeFileOpenDirectory sPath. In addition, with each arbitrary other
Word function gives it this message. I have to define tried "oWord" as
Public, but that did not also help me. Does someone have one perhaps taps as
I this error to repair can?"

Ok, that was fun! Now let's try something else.

Are you sure the error occurs on the .Open call? It doesn't occur on the New
Word.Applcation?

Perhaps try:

set objword = createobject ("word.application")

MS says: "When creating an instance of an Microsoft Office application, use
CreateObject instead of New. CreateObject more closely maps to the creation
process used by most Visual C++ clients, and allows for possible changes in
the server's CLSID between versions. CreateObject can be used with both
early-bound and late-bound objects."

HTH,
TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:zM*****************@newsread4.news.pas.earthl ink.net...
"Run-time error '-2147023067 (80070725)': Automation error."

"TC" <a@b.c.d> wrote in message news:1067480554.540605@teuthos...
*What* automation error?

TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:5t*****************@newsread3.news.pas.earthl ink.net...
I have a strange situation with my Access 2000 database. I have code in
the
database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's machines. The code opens MS
Word through Automation and then opens a particular Word doc. It's still

working
fine on most machines; but on one or two of them, the user is getting an Automation Error. The code used is as follows:

Dim objWord As Word.Application
Set objWord = New Word.Application
objWord.Documents.Open FileName:=strFilename, _
ConfirmConversions:=False, _
ReadOnly:=False, _
AddToRecentFiles:=False, _
Revert:=False, _
Format:=gcon_wdOpenFormatAuto 'this is global constant with Word constant value

The Automation Error occurs on the third line, when trying to open the
document (the document does exist, so that's not the problem).

Even stranger than the fact that the problem's only happening on two out
of
several dozen machines, is the following. I have a pared-down copy of the database, that users use to take on the road with them and show to

clients.
The pared-down version (call it "App B") was taken from the original (call it "App A") with some functionality removed. Regarding the above code

that's
failing, both App A and App B are identical, and both have the same
references.

Now, here's the really strange part.

On one computer that's having problems, App A fails in the above code. On the other computer that's having problems, App A works fine in the
above code, but App B fails in that code. So, in the second case, with the

same computer and two identical sets of code, one set fails, the other doesn't.
I've looked at backup copies to see if it was a corruption issue, and
haven't seen any difference. And, as noted, this code has been in
place for
years without problems, until just the other day when these problems

started
happening.

All of the users have MS Office and the database application installed

on their C drives.

Any assistance would be appreciated.

Thanks!

Neil


Nov 12 '05 #6

P: n/a
> Are you sure the error occurs on the .Open call? It doesn't occur on the
New
Word.Applcation?
Yes, positive. I thought that was a bit strange myself. It also occurs if I
try to do anything else (i.e., skip the offending line), such as set the
application's Visible property to True, etc. In other Words, it creates the
object fine; but then it won't do anything with it!

Perhaps try:

set objword = createobject ("word.application")
That's the code I'm using. Wait a minute: in my message I posted other code.

OK, I may have stumbled upon something. I just noticed that the original app
I referred to as "App A" uses the code:

Set objWord = New Word.Application

whereas the pared-down app I referred to as "App B" uses:

Set objWord = CreateObject("Word.Application")

On the computer I have access to (via PC Anywhere), App A is working fine,
but App B isn't. So that might be something to try. (Still doesn't explain
why it would all of a sudden start having problems, when my notes show that
I changed the App A code last June -- must have forgotten that I had done
that -- but at least it's a start!)

MS says: "When creating an instance of an Microsoft Office application, use CreateObject instead of New. CreateObject more closely maps to the creation process used by most Visual C++ clients, and allows for possible changes in the server's CLSID between versions. CreateObject can be used with both
early-bound and late-bound objects."
That would actually be the opposite of what I'm finding -- that the one with
New is working, but the one with CreateObject isn't. Oh well, whatever takes
care of the problem. Will try that and see how it goes.

HTH,
Indeed!

Thanks,

Neil
TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:zM*****************@newsread4.news.pas.earthl ink.net...
"Run-time error '-2147023067 (80070725)': Automation error."

"TC" <a@b.c.d> wrote in message news:1067480554.540605@teuthos...
*What* automation error?

TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:5t*****************@newsread3.news.pas.earthl ink.net...
> I have a strange situation with my Access 2000 database. I have code in the
> database which has worked fine for years, and now all of a sudden doesn't
> work fine on one or two of my client's machines. The code opens MS Word > through Automation and then opens a particular Word doc. It's still
working
> fine on most machines; but on one or two of them, the user is getting an
> Automation Error. The code used is as follows:
>
> Dim objWord As Word.Application
> Set objWord = New Word.Application
> objWord.Documents.Open FileName:=strFilename, _
> ConfirmConversions:=False, _
> ReadOnly:=False, _
> AddToRecentFiles:=False, _
> Revert:=False, _
> Format:=gcon_wdOpenFormatAuto 'this is global constant with > Word constant value
>
> The Automation Error occurs on the third line, when trying to open
the > document (the document does exist, so that's not the problem).
>
> Even stranger than the fact that the problem's only happening on two out of
> several dozen machines, is the following. I have a pared-down copy of the
> database, that users use to take on the road with them and show to
clients.
> The pared-down version (call it "App B") was taken from the original

(call
> it "App A") with some functionality removed. Regarding the above
code that's
> failing, both App A and App B are identical, and both have the same
> references.
>
> Now, here's the really strange part.
>
> On one computer that's having problems, App A fails in the above code.
On
> the other computer that's having problems, App A works fine in the above > code, but App B fails in that code. So, in the second case, with the

same
> computer and two identical sets of code, one set fails, the other

doesn't.
>
> I've looked at backup copies to see if it was a corruption issue,
and > haven't seen any difference. And, as noted, this code has been in

place for
> years without problems, until just the other day when these problems
started
> happening.
>
> All of the users have MS Office and the database application

installed on
> their C drives.
>
> Any assistance would be appreciated.
>
> Thanks!
>
> Neil


Nov 12 '05 #7

P: n/a
Here is a KB article that might be helpful:

INFO: Translating Large Office Automation Error Values
http://support.microsoft.com/default...roduct=acc2000

It includes a link to this KB article:
INFO: Translating Automation Errors for VB/VBA (Long)
http://support.microsoft.com/default.aspx?kbid=186063
When I ran the MessageText function with the error number you reported, I get the
following result. Note: I had to change the scope of the function from Private to Public.

?MessageText(-2147023067)
Incompatible version of the RPC stub.

Hmmm....what does this helpful message mean? I conducted a search of the Knowledge Base
at:
http://support.microsoft.com/default...;EN-US;KBHOWTO

using the text returned by the MessageText function. I specified "All Microsoft Products"
and "Using: All of the words entered". I found 7 hits, one of which looks particularly
promising:

PRB: Office Automation Fails with an Incompatible RPC Stub Error
http://support.microsoft.com/default...b;en-us;320108

I think you may find the answer in the above KB article!

Good Luck, and please report your findings back to the newsgroup.

Tom
___________________________________________

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:PU*****************@newsread4.news.pas.earthl ink.net...

In my case, Err.Number = -2147023067 and vbObjectError = -2147221504.
Subtracting the second from the first I get 198437, which according to your
notes means it's a VBA error. I'm not sure where that gets me, since the VBA
code hasn't changed years and it started being problematic a couple of days
ago. Any ideas?

Thanks,

Neil
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg1.svr.pol.co.uk...
the user is getting an Automation Error.


Neil

I don't know if this might help pinpoint the problem.

Have you written an error handler to display the
automation error using the vbObjectError constant?

If you need it, the following information relates to the
vbObjectError constant:

1. Subtracting vbObjectError from Err.Number will
indicate the error as defined by the server application.

2. However, if subtracting vbObjectError from Err.Number
results in a number outside the range 0 - 65535, the
error is a VBA error.

Therefore, your error handler might look like:

' Remove the constant added by the server application:
MyError = Err.Number - vbObjectError

' Is the result in the range 0 - 65535?
If MyError > 0 and MyError < 65535 then

Msg = "The object you accessed assigned this number to " & _
"the error: " & MyError & ". The originator of " & _
"the error was: " & Err.Source & ". Press F1 to " & _
"see the originating applications' help topic."

Else ' It's a VBA error:

Msg = "This error " & Err.Number & " is a VBA error. " & _
"Press Help button or F1 for VBA Help topic on " & _
"this error."

End if

Msgbox Msg, , "Object Error", Err.Helpfile, Err.HelpContext
Obviously, this doesn't solve your problem, but it may
help you identify it.

HTH
Geoff


Nov 12 '05 #8

P: n/a
rkc

"TC" <a@b.c.d> wrote in message news:1067486213.516312@teuthos...
I found a couple of posts about this error: both in German! Here's one,
translated by altavista:
<snip translation>
Ok, that was fun! Now let's try something else.


Cracked me up.
Nov 12 '05 #9

P: n/a
Neil

Now that this thread has arrived on my machine and
notwithstanding Tom's lead in the other thread (which
perhaps offers more hope).

Word is (I believe) an application that likes to have only
one instance running - although I think I've got multiple
instances running from code before now for reasons
I've never got to the bottom of. Also, I've read some
incomprehensible stuff on memory not being released
when some object variables are set to Nothing after
they've been created using 'New' (even when no other
variables are pointing to the same object).

So, as you're using CreateObject, is there any mileage
in using the GetObject function first (to utilise any
running instance of Word, if Word prefers to be in
memory only once or simply to save system resources).
And, if GetObject produces error 429, then using
CreateObject?

I've seen two coding variations for the above, each of
which uses a boolean variable to leave Word running
if GetObject was successful, but quit Word if
CreateObject was successful. (I can post samples if
you want them.)

No doubt you're destroying object variables when
no longer needed by setting them to Nothing.

Presumably all Office/Windows service packs are
installed on the offending machine.

I realise this doesn't address your specific issue or
the bizarre nature of your code suddenly not
working - but HTH.

Like Tom, I'd be interested in your solution.

Regards
Geoff
Nov 12 '05 #10

P: n/a
Thanks for the note. I've had better success with opening new instances in
the past in other situations. Found some bizarre behavior when using
existing instances of Word. Either way, it happens with a clean boot.

Will let you know what happens.

Thanks,

Neil

"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg2.svr.pol.co.uk...
Neil

Now that this thread has arrived on my machine and
notwithstanding Tom's lead in the other thread (which
perhaps offers more hope).

Word is (I believe) an application that likes to have only
one instance running - although I think I've got multiple
instances running from code before now for reasons
I've never got to the bottom of. Also, I've read some
incomprehensible stuff on memory not being released
when some object variables are set to Nothing after
they've been created using 'New' (even when no other
variables are pointing to the same object).

So, as you're using CreateObject, is there any mileage
in using the GetObject function first (to utilise any
running instance of Word, if Word prefers to be in
memory only once or simply to save system resources).
And, if GetObject produces error 429, then using
CreateObject?

I've seen two coding variations for the above, each of
which uses a boolean variable to leave Word running
if GetObject was successful, but quit Word if
CreateObject was successful. (I can post samples if
you want them.)

No doubt you're destroying object variables when
no longer needed by setting them to Nothing.

Presumably all Office/Windows service packs are
installed on the offending machine.

I realise this doesn't address your specific issue or
the bizarre nature of your code suddenly not
working - but HTH.

Like Tom, I'd be interested in your solution.

Regards
Geoff

Nov 12 '05 #11

P: n/a
TC

"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg2.svr.pol.co.uk...

(snip)
Word is (I believe) an application that likes to have only
one instance running


Geoff, that's not really so. There is no problem having multiple instances
of Word running. In some cases, you might *prefer* to have a seperate
instance, to avoid disturbing whatever the user is doing "manually" with an
"existing" copy of Word.

HTH,
TC

Nov 12 '05 #12

P: n/a
TC

"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message
news:cv*******************@twister.nyroc.rr.com...

"TC" <a@b.c.d> wrote in message news:1067486213.516312@teuthos...
I found a couple of posts about this error: both in German! Here's one,
translated by altavista:


<snip translation>
Ok, that was fun! Now let's try something else.


Cracked me up.

I particularly liked "NT 4.0 with service luggage 6a" !!

TC
Nov 12 '05 #13

P: n/a
I guess I could have found the link to the KB article a lot easier, which I gave at the
end of my earlier reply, if I had only known how to search correctly! Go to the Microsoft
KB, and simply enter -2147023067 as the search term. You need to select either
Office 2003 or "All Microsoft Products" in the "Select a Microsoft Product" dropdown.

Note: You won't find anything if you select any of the following products:

Access 2000
Office 2000
Access 2002
Office XP
Access 2003

That's pretty amazing, considering that at the bottom of the article, one finds the
following:
The information in this article applies to:
a.. Microsoft Visual Basic Enterprise Edition for Windows 5.0
b.. Microsoft Visual Basic Enterprise Edition for Windows 6.0
c.. Microsoft Visual C++, 32-bit Professional Edition 5.0
d.. Microsoft Visual C++, 32-bit Professional Edition 6.0
e.. Microsoft Office 2003, All Editions
f.. Microsoft Office XP Developer
and I would have thought that Access 2002 is a part of Office XP, and that Access 2003 is
a part of Office 2003.

__________________________________________________ ___

"Tom Wickerath" <AO***********************@comcast.net> wrote in message
news:Ar********************@comcast.com...

Here is a KB article that might be helpful:

INFO: Translating Large Office Automation Error Values
http://support.microsoft.com/default...roduct=acc2000

It includes a link to this KB article:
INFO: Translating Automation Errors for VB/VBA (Long)
http://support.microsoft.com/default.aspx?kbid=186063
When I ran the MessageText function with the error number you reported, I get the
following result. Note: I had to change the scope of the function from Private to Public.

?MessageText(-2147023067)
Incompatible version of the RPC stub.

Hmmm....what does this helpful message mean? I conducted a search of the Knowledge Base
at:
http://support.microsoft.com/default...;EN-US;KBHOWTO

using the text returned by the MessageText function. I specified "All Microsoft Products"
and "Using: All of the words entered". I found 7 hits, one of which looks particularly
promising:

PRB: Office Automation Fails with an Incompatible RPC Stub Error
http://support.microsoft.com/default...b;en-us;320108

I think you may find the answer in the above KB article!

Good Luck, and please report your findings back to the newsgroup.

Tom
___________________________________________

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:PU*****************@newsread4.news.pas.earthl ink.net...

In my case, Err.Number = -2147023067 and vbObjectError = -2147221504.
Subtracting the second from the first I get 198437, which according to your
notes means it's a VBA error. I'm not sure where that gets me, since the VBA
code hasn't changed years and it started being problematic a couple of days
ago. Any ideas?

Thanks,

Neil
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg1.svr.pol.co.uk...
the user is getting an Automation Error.


Neil

I don't know if this might help pinpoint the problem.

Have you written an error handler to display the
automation error using the vbObjectError constant?

If you need it, the following information relates to the
vbObjectError constant:

1. Subtracting vbObjectError from Err.Number will
indicate the error as defined by the server application.

2. However, if subtracting vbObjectError from Err.Number
results in a number outside the range 0 - 65535, the
error is a VBA error.

Therefore, your error handler might look like:

' Remove the constant added by the server application:
MyError = Err.Number - vbObjectError

' Is the result in the range 0 - 65535?
If MyError > 0 and MyError < 65535 then

Msg = "The object you accessed assigned this number to " & _
"the error: " & MyError & ". The originator of " & _
"the error was: " & Err.Source & ". Press F1 to " & _
"see the originating applications' help topic."

Else ' It's a VBA error:

Msg = "This error " & Err.Number & " is a VBA error. " & _
"Press Help button or F1 for VBA Help topic on " & _
"this error."

End if

Msgbox Msg, , "Object Error", Err.Helpfile, Err.HelpContext
Obviously, this doesn't solve your problem, but it may
help you identify it.

HTH
Geoff



Nov 12 '05 #14

P: n/a
> and I would have thought that Access 2002 is a part of Office XP, and that
Access 2003 is
a part of Office 2003.


Remember: indexers are just poor slobs who have stared at too many
characters over too many cups of coffee for too many hours.

Neil
Nov 12 '05 #15

P: n/a
Here's an update on the situation.

You'll recall that there are two machines with problems, and two apps --
"App A" (the original) and "App B" (the pared-down version). One machine had
problems with automation with App A; the other machine worked with App A but
had automation issues with App B. No other machines had problems. At least
part of the puzzle has been resolved.

The user who was having trouble with App A had created a shortcut to Word on
her own, and, it turns out, she found an old copy of Word 97 on the server
and opened that instead of Word 2000. After that, the automation code in
Access didn't work (the reference was to Word 2000) -- though, for some
reason, it was able to open Word and create the reference, but wasn't able
to do anything with it. Once she stopped using that shortcut and began using
Word 2000 again, the problem went away.

So that takes care of that.

Regarding the second issue, as noted in my response to TC, it turns out that
I *did* have different code between App A and App B -- App A had been
changed a few months back, though I forgot about it. App A was using early
binding, and App B was using late binding. And, despite the literature,
early binding was working, but late binding wasn't. So I changed App B to
early binding to match App A, but it's still not working.

And that's where I'm at now.

Neil
All the news that's fit to print.
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg2.svr.pol.co.uk...
Neil

Now that this thread has arrived on my machine and
notwithstanding Tom's lead in the other thread (which
perhaps offers more hope).

Word is (I believe) an application that likes to have only
one instance running - although I think I've got multiple
instances running from code before now for reasons
I've never got to the bottom of. Also, I've read some
incomprehensible stuff on memory not being released
when some object variables are set to Nothing after
they've been created using 'New' (even when no other
variables are pointing to the same object).

So, as you're using CreateObject, is there any mileage
in using the GetObject function first (to utilise any
running instance of Word, if Word prefers to be in
memory only once or simply to save system resources).
And, if GetObject produces error 429, then using
CreateObject?

I've seen two coding variations for the above, each of
which uses a boolean variable to leave Word running
if GetObject was successful, but quit Word if
CreateObject was successful. (I can post samples if
you want them.)

No doubt you're destroying object variables when
no longer needed by setting them to Nothing.

Presumably all Office/Windows service packs are
installed on the offending machine.

I realise this doesn't address your specific issue or
the bizarre nature of your code suddenly not
working - but HTH.

Like Tom, I'd be interested in your solution.

Regards
Geoff

Nov 12 '05 #16

P: n/a
Here's a new twist. I just went into App B with the new early binding code
on the machine that's having problems (no other machine has problems), and
ran the code to open a Word doc. Interesting results. I get a message that
the specific document is locked by another user (the current user of that
machine) and I'm given the option of opening it Read Only, etc. I select
Read Only and the document opens in Word. I then go back to my app, and
there's the same Automation Error as before -- only, instead of it being on
the line that opens the Word doc, it's on the line:

objWord.visible = True

The Word instance was already visible, since I saw the document open. But
that line of code hadn't been executed.

Again, this is the same code that's running fine on other machines.
Interesting.

Neil

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:hT******************@newsread4.news.pas.earth link.net...
Here's an update on the situation.

You'll recall that there are two machines with problems, and two apps --
"App A" (the original) and "App B" (the pared-down version). One machine had problems with automation with App A; the other machine worked with App A but had automation issues with App B. No other machines had problems. At least
part of the puzzle has been resolved.

The user who was having trouble with App A had created a shortcut to Word on her own, and, it turns out, she found an old copy of Word 97 on the server
and opened that instead of Word 2000. After that, the automation code in
Access didn't work (the reference was to Word 2000) -- though, for some
reason, it was able to open Word and create the reference, but wasn't able
to do anything with it. Once she stopped using that shortcut and began using Word 2000 again, the problem went away.

So that takes care of that.

Regarding the second issue, as noted in my response to TC, it turns out that I *did* have different code between App A and App B -- App A had been
changed a few months back, though I forgot about it. App A was using early
binding, and App B was using late binding. And, despite the literature,
early binding was working, but late binding wasn't. So I changed App B to
early binding to match App A, but it's still not working.

And that's where I'm at now.

Neil
All the news that's fit to print.
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg2.svr.pol.co.uk...
Neil

Now that this thread has arrived on my machine and
notwithstanding Tom's lead in the other thread (which
perhaps offers more hope).

Word is (I believe) an application that likes to have only
one instance running - although I think I've got multiple
instances running from code before now for reasons
I've never got to the bottom of. Also, I've read some
incomprehensible stuff on memory not being released
when some object variables are set to Nothing after
they've been created using 'New' (even when no other
variables are pointing to the same object).

So, as you're using CreateObject, is there any mileage
in using the GetObject function first (to utilise any
running instance of Word, if Word prefers to be in
memory only once or simply to save system resources).
And, if GetObject produces error 429, then using
CreateObject?

I've seen two coding variations for the above, each of
which uses a boolean variable to leave Word running
if GetObject was successful, but quit Word if
CreateObject was successful. (I can post samples if
you want them.)

No doubt you're destroying object variables when
no longer needed by setting them to Nothing.

Presumably all Office/Windows service packs are
installed on the offending machine.

I realise this doesn't address your specific issue or
the bizarre nature of your code suddenly not
working - but HTH.

Like Tom, I'd be interested in your solution.

Regards
Geoff


Nov 12 '05 #17

P: n/a
Did you work as an "indexer" as your first job? <smile>

Also, have you been able to rule out the possibility of incorrect OLE Automation
system files? I was thinking that perhaps this particular PC does not have the
Windows XP operating system, but it had some other software installed, which may
have installed an incorrect version of the OLE Automation files intended for
Windows XP. That scenerio may have led to the automation error you reported for
your application....

_____________________________________

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:D3*****************@newsread3.news.pas.earthl ink.net...
and I would have thought that Access 2002 is a part of Office XP, and that
Access 2003 is a part of Office 2003.


Remember: indexers are just poor slobs who have stared at too many
characters over too many cups of coffee for too many hours.

Neil

Nov 12 '05 #18

P: n/a
TC
Keep us posted!

TC
"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:s0******************@newsread4.news.pas.earth link.net...
Here's a new twist. I just went into App B with the new early binding code
on the machine that's having problems (no other machine has problems), and
ran the code to open a Word doc. Interesting results. I get a message that
the specific document is locked by another user (the current user of that
machine) and I'm given the option of opening it Read Only, etc. I select
Read Only and the document opens in Word. I then go back to my app, and
there's the same Automation Error as before -- only, instead of it being on the line that opens the Word doc, it's on the line:

objWord.visible = True

The Word instance was already visible, since I saw the document open. But
that line of code hadn't been executed.

Again, this is the same code that's running fine on other machines.
Interesting.

Neil

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:hT******************@newsread4.news.pas.earth link.net...
Here's an update on the situation.

You'll recall that there are two machines with problems, and two apps --
"App A" (the original) and "App B" (the pared-down version). One machine had
problems with automation with App A; the other machine worked with App A

but
had automation issues with App B. No other machines had problems. At least part of the puzzle has been resolved.

The user who was having trouble with App A had created a shortcut to Word on
her own, and, it turns out, she found an old copy of Word 97 on the

server and opened that instead of Word 2000. After that, the automation code in
Access didn't work (the reference was to Word 2000) -- though, for some
reason, it was able to open Word and create the reference, but wasn't able to do anything with it. Once she stopped using that shortcut and began

using
Word 2000 again, the problem went away.

So that takes care of that.

Regarding the second issue, as noted in my response to TC, it turns out

that
I *did* have different code between App A and App B -- App A had been
changed a few months back, though I forgot about it. App A was using early binding, and App B was using late binding. And, despite the literature,
early binding was working, but late binding wasn't. So I changed App B to early binding to match App A, but it's still not working.

And that's where I'm at now.

Neil
All the news that's fit to print.
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bn**********@newsg2.svr.pol.co.uk...
Neil

Now that this thread has arrived on my machine and
notwithstanding Tom's lead in the other thread (which
perhaps offers more hope).

Word is (I believe) an application that likes to have only
one instance running - although I think I've got multiple
instances running from code before now for reasons
I've never got to the bottom of. Also, I've read some
incomprehensible stuff on memory not being released
when some object variables are set to Nothing after
they've been created using 'New' (even when no other
variables are pointing to the same object).

So, as you're using CreateObject, is there any mileage
in using the GetObject function first (to utilise any
running instance of Word, if Word prefers to be in
memory only once or simply to save system resources).
And, if GetObject produces error 429, then using
CreateObject?

I've seen two coding variations for the above, each of
which uses a boolean variable to leave Word running
if GetObject was successful, but quit Word if
CreateObject was successful. (I can post samples if
you want them.)

No doubt you're destroying object variables when
no longer needed by setting them to Nothing.

Presumably all Office/Windows service packs are
installed on the offending machine.

I realise this doesn't address your specific issue or
the bizarre nature of your code suddenly not
working - but HTH.

Like Tom, I'd be interested in your solution.

Regards
Geoff



Nov 12 '05 #19

P: n/a
Thanks for the kick up the proverbial...

You've forced me to re-read about single-use and
multiple-use application classes.

I see that Word's application class is single-use (by
default) or multiple-use. This was the missing piece
of the jigsaw in my understanding of using 'New',
'CreateObject' and 'GetObject'.

This seems amazing now as I've been using these
commands successfully for some time.

Thanks again.
Geoff



Nov 12 '05 #20

P: n/a
> Again, this is the same code that's running
fine on other machines.


Neil,

Starting from the above premise, if the code runs fine
on other machines, then it seems the problem is not
with the code, but with the user or the machine.

User: Does the user only have read-only rights to
the folder in which the Word document is stored?

(Presumably the file is not read-only if other users
are OK.)

Machine:
* Is the network connection OK?
* Is the software on this machine up-to-date?
* Is the right software being used?

(Don't you just love users who set up shortcuts?
Who'd have thought of that one?)

Waiting with bated breath for your patience to
snap so we get to see the unprintable comments!

Regards
Geoff

PS I don't get the early/late-binding issue if
references were set correctly.

Nov 12 '05 #21

P: n/a
I agree that it seems to be the machine. The app appears to have no problems
on any other machine, and, now that the other issue (where the user was
opening an old version of Word) is resolved, I'm chalking this last issue up
to the machine, and stepping away from it for a while. The machine that's
having problems is only used as a dial-up portal for us PCAnywhere users, so
it's not a biggie. So, for now, I'm letting it drop. If I ever get this
resolved, I'll be sure to post it here.

Thanks everyone for your help!

(Sorry about not having any unprintable comments to print! :-) )

Neil
"Geoff" <ge***@nospam.for.me.com> wrote in message
news:bo**********@news8.svr.pol.co.uk...
Again, this is the same code that's running
fine on other machines.


Neil,

Starting from the above premise, if the code runs fine
on other machines, then it seems the problem is not
with the code, but with the user or the machine.

User: Does the user only have read-only rights to
the folder in which the Word document is stored?

(Presumably the file is not read-only if other users
are OK.)

Machine:
* Is the network connection OK?
* Is the software on this machine up-to-date?
* Is the right software being used?

(Don't you just love users who set up shortcuts?
Who'd have thought of that one?)

Waiting with bated breath for your patience to
snap so we get to see the unprintable comments!

Regards
Geoff

PS I don't get the early/late-binding issue if
references were set correctly.

Nov 12 '05 #22

P: n/a

"Tom Wickerath" <AOS168 AT Comcast DOT com> wrote in message
news:Hn********@news.boeing.com...
Did you work as an "indexer" as your first job? <smile>
Actually, I was a tech writer for a few years and had to do my own indexes.
As much as I'd want the indexes to be perfect, there were always flaws in
them, and it was always a tedious job that I couldn't wait to be finished
with. So I have sympathy for indexers and have come to not expect much from
indexes (or, at least, I'm willing to see the human element in the index).
Also, have you been able to rule out the possibility of incorrect OLE Automation system files? I was thinking that perhaps this particular PC does not have the Windows XP operating system, but it had some other software installed, which may have installed an incorrect version of the OLE Automation files intended for Windows XP. That scenerio may have led to the automation error you reported for your application....
That could be. It seems clearly to be something with the machine, and that
seems a likely explanation.

Neil


_____________________________________

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:D3*****************@newsread3.news.pas.earthl ink.net...
and I would have thought that Access 2002 is a part of Office XP, and that Access 2003 is a part of Office 2003.


Remember: indexers are just poor slobs who have stared at too many
characters over too many cups of coffee for too many hours.

Neil

Nov 12 '05 #23

P: n/a
I should add that there are "professional indexers" who do nothing but that.
So, apparently, they're not all poor overworked slobs. Some actually thrive
in that field. I just recall how I felt when I did my indexes.........

:-)

Neil

"Tom Wickerath" <AOS168 AT Comcast DOT com> wrote in message
news:Hn********@news.boeing.com...
Did you work as an "indexer" as your first job? <smile>

Nov 12 '05 #24

P: n/a
I know you indicated in another post (11/3/03, 11:25 PM) that:

"So, for now, I'm letting it drop. If I ever get this
resolved, I'll be sure to post it here".

But, I'm still curious if the OLE Automation system files might be the issue. Can you
search for the file named "Oleaut32.dll" on the PC that is still having the problem, and
report back which version that it is? Also, which operating system does this machine
have?

Ref.: http://support.microsoft.com/default...b;en-us;320108

_____________________________________________

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:Jx*****************@newsread4.news.pas.earthl ink.net...
That could be. It seems clearly to be something with the machine, and that
seems a likely explanation.

Neil
_____________________________________________

Also, have you been able to rule out the possibility of incorrect OLE Automation system
files? I was thinking that perhaps this particular PC does not have the Windows XP
operating system, but it had some other software installed, which may have installed an
incorrect version of the OLE Automation files intended for Windows XP. That scenario may
have led to the automation error you reported for your application....
Nov 12 '05 #25

P: n/a
> But, I'm still curious if the OLE Automation system files might be the
issue. Can you
search for the file named "Oleaut32.dll" on the PC that is still having the problem, and report back which version that it is? Also, which operating system does this machine have?


The machine is running Win 98 SE, and the version of Oleaut32 is
3.50.5016.0. However, after posting my message last night I realized that it
has to be something else. Recall that there was "App A" (original) and "App
B" (pared-down copy), and that App A works on that machine, whereas App B
doesn't. I did determine while responding to TC that App B used late
binding, so I changed it to match App A's early-binding code. After that,
the problem shifted a bit so that it does open the Word doc (previously
didn't), though it first tells me that it's locked by me; but then fails
when setting Word to visible (and Word was already visible).

So the bottom line is that App B is having problems (albeit different ones
than originally) whereas App A isn't, and they both have the same code and
references, from what I can see. So this doesn't make sense. But, if there's
any consolation, it would be that App B apparently works fine on all other
machines. So go figure......

If you want me to look at anything else, let me know.

Neil
Nov 12 '05 #26

This discussion thread is closed

Replies have been disabled for this discussion.