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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Server machine does not exist

Status
Not open for further replies.

ycim

Programmer
Feb 9, 2005
95
CA
I am accessing Word through VBA from access. I get the following message:

Error 462: The remote server machine does not exist or is unavailable.

It stops on the line setdocorig = documents.open

Code:
Dim wd As Word.Application
Dim docOrig As Word.Document
Set wd = CreateObject("word.application")

Do While Not rstTemp.EOF()   'rstTemp created earlier in the program
    setDocName = rstTemp!filename
    set docOrig = Documents.Open(Filename:=strDocName, ConfirmConversions:=False, _
                    ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
                    PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
                    WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:="")

'some code here to get the customdocumentproperties (this part works)
  blah blah blah

rstTemp.movenext
Loop

docorig.close
wd.quit

Can anyone tell me why I get this message? If I go out of the program, and back into it, it works just fine. But after I run it once, and I just close the form, it does not work just fine. What type of error should I be looking for?
 
Without testing it my guess is that the instance of Word you are creating is not terminating, which is why it runs correctly the first time but subsequent runs are unsuccessful.

Try putting the following at the end of your code:

Code:
Set docorig = Nothing
Set wd = Nothing

Please do not feed the trolls.....
 
I actually had this in my code already (sorry..I didn't include it in the first post).

Any other ideas?
 
Have you checked Task Manager after the initial run to see whether there is an instance or Word still running?

Ed Metcalfe.

Please do not feed the trolls.....
 
set docOrig = [!]wd.[/!]Documents.Open(Filename:=strDocName, ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
AHH...that got it!

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top