Results 1 to 3 of 3

Thread: [RESOLVED] 462 The remote server machine does not exist or is unavailable

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2015
    Posts
    2

    Resolved [RESOLVED] 462 The remote server machine does not exist or is unavailable

    Hi,

    I've looked around and found multiple solutions to this error but I can't seem to find the one that's right for my code, I'm new to VB and would appreciate any help my code is:

    Code:
    Option Explicit
    Const FilePath As String = "P:\C & C Spreadsheets\Jobs\Jobs In\"
    Dim wd As New Word.Application
    Dim PersonCell As Range
    Sub Job()
    Dim doc As Word.Document
    wd.Visible = True
    Dim PersonRange As Range
    
    ActiveCell.Select
    Set PersonRange = Range("A" & (ActiveCell.Row))
    For Each PersonCell In PersonRange
    Set doc = wd.Documents.Open(FilePath & "bookmarktest1.dotm")
    CopyCell "Job", 1
    CopyCell "Company", 4
    CopyCell "Desciption", 12
    CopyCell "Order", 11
    CopyCell "Powder", 9
    CopyCell "Price", 13
    CopyCell "Date", 3
    CopyCell "Accepted", 17
    CopyCell "Delivery", 2
    doc.SaveAs2 FilePath & PersonCell.Value & ".doc"
    doc.PrintOut
    doc.Close
    Next PersonCell
    wd.Quit
    
    End Sub
    Sub CopyCell(Company As String, Job As Integer)
    wd.Selection.GoTo What:=wdGoToBookmark, Name:=Company
    wd.Selection.TypeText PersonCell.Offset(0, Job).Value
    End Sub
    Thanks,
    Jamie

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,965

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

    on which line does the error occur?

    do you assign a value to the wd variable anywhere?
    set wd = word.application

    you should be opening a new document based on the template, rather than opening the template
    you need to specify the document type to saveAs as it would appear to be a different type to the document you open

    check if the Word constants are valid within excel
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2015
    Posts
    2

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

    never mind it's fixed now, thank you so much for your help,

    For anyone else having this problem, I just added;

    Set wd = New Word.Application

    under Sub Job()

    Thanks again Westconn,

    Jamie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width