Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime error '462' Access/Word 1

Status
Not open for further replies.

Crookshanks

Technical User
Joined
May 18, 2004
Messages
296
Location
NL
Goodmorning,

I do not understand why the following messages appears:
"runtime error 462 -- The remote server does not exist or is unavailable."

My access application processes some letters using Word. The Word session is declared as follows

Dim appWord As New Word.Application 'Automation Object

Now I perform several tasks with the appWord object. Like writing to bookmarks, printing and saving. After that I close the document and application with:

appWord.ActiveDocument.close
appWord.Quit

Now when I try to rerun my procedure (for another letter) the error mentioned above occurs. When I ommit the 'appWord.quit' this does not occur, but now Word stays 'open' and I want it to close.

Anyone an idea why this is happening, is there a solution? Any help appreciated.

Kind regards,
 
You may try to replace this:
Dim appWord As New Word.Application 'Automation Object
By this:
Dim appWord As Word.Application 'Automation Object
Set appWord =CreateObject("Word.Application")

Furthermore check all the code dealing with the word automation for any implicit instanciation of theWord object (like eg Selection instead of appWord.Selection).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I tried something alike myself
dim appWord as Word.application
set appword = new Word.application
...... code ....
appword.quit
set appword = nothing

and it worked ... thanks for your answer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top