Word Automation Error 462 The remote server machine does not exist or is unavailable

A

AG

I am using Automation from Access 2000 to create a Word 2000 document.
I have searched the web and found other posts, but no real solutions.

Most of the time it works fine, but sometimes I receive error 462, The
remote server machine does not exist or is unavailable.

The first line that generates the error usually contains a call to
InchedToPoints.
However, if I skip over those lines, it will pop up somewhere else, like in
a reference to a document.

Sometimes it happens when Word is already open, and sometimes when it is not
already open.
Task manager does not show any unexpected instances of Word.

If I close Access and reopen it, then everything works fine.

I am using early binding and here is a sample of my code.

Private Function fnWordDoc () as Boolean

Dim appWord As Word.Application
Dim docWord As Word.Document

On Error GoTo ErrLine
Set appWord = GetObject(, "Word.Application")
Set docWord = appWord.Documents.Add

'do my stuff here

fnWordDoc = True

ErrLine:
'clean up all objects
Exit Function

ErrLine:
If Err.Number = 429 Then
Set appWord = New Word.Application '
CreateObject("Word.Application")
Resume Next
Else
'My global error reporter
End If
Resume ExitLine

Any help in eliminating the error would be appreciated.
 
Joined
Dec 22, 2011
Messages
1
Reaction score
0
Error 462

By Adding the object name to all Commands to word worked for me.
‘ Initialise the word Object
Dim wrd As Word.Application
Set wrd = GetObject(, "Word.Application")

wrd.Visible = True
wrd.Documents.Open SaveName
AppActivate "Microsoft Word", False
‘Precede all commands by wrd. Or the name you have given the word object
wrd.ActiveDocument.FormFields("Text1").Result = Me.Brand
wrd.ActiveDocument.FormFields("Text5").Result = Me.Brand
‘At end of program release object
Set wrd = Nothing
 

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