title: Error 462: The remote server machine does not exist when working with Word via Excel VBA
body: <p>I open a Word file programmatically in Excel VBA and add/edit contents using bookmarks.</p>
  
  <p>I find that on alternate runs, I get</p>
  
  <blockquote>
    <p>Error 462: The remote server does not exist</p>
  </blockquote>
  
  <p>I researched and understood this has something to do with 'Unqualified references'.</p>
  
  <p>I don't understand how to correct the code to qualified references.</p>
  
  <pre><code>        Set exR = ActiveSheet.Range(TestIdCol &amp; CStr(DataRowNum) &amp; ":" &amp; TestIdCol &amp; CStr(RowEnd))
  
             ExistingEvidenceDoc = UseFileDialogOpen("Word Documents", "*.doc;*.docx")
  
             Set objWord = CreateObject("Word.Application")
  
             If ExistingEvidenceDoc &lt;&gt; "" Then
                  Set objDoc = objWord.Documents.Open(ExistingEvidenceDoc)
             Else
                  Exit Sub
             End If
  
             objWord.Visible = True
             Application.Wait Now() + TimeSerial(0, 0, 5)
  
  
             Set objSelection = objWord.Selection
  
             getExistingEvidences = ExistingTestEvidences(objDoc)
             o = DataRowNum
              For Each cell In exR
                  If cell.Value &lt;&gt; "" And Not IsInArray(cell.Value, getExistingEvidences) Then
                      objSelection.Style = ActiveDocument.Styles("Heading 1")
                      objSelection.TypeText text:="Heading " + cell.Value
                      objSelection.TypeParagraph
                      objSelection.MoveLeft
                      objSelection.HomeKey Unit:=wdLine
                      objSelection.EndKey Unit:=wdLine, Extend:=wdExtend
                      objDoc.Bookmarks.Add Name:="BMrk" + CStr(o), Range:=objSelection
                      objSelection.Copy
                      ActiveSheet.Range("Q" + CStr(o)).Select
                             ActiveSheet.PasteSpecial Format:="Hyperlink", Link:=False, DisplayAsIcon _
                                     :=False
                      objSelection.MoveRight
  
                      'objSelection.Style = ActiveDocument.Styles("Paragraph")
                      objSelection.TypeText text:=Range(DescriptionCol + CStr(cell.Row)).Value
                      objSelection.TypeParagraph
  
  
                  ElseIf IsInArray(cell.Value, getExistingEvidences) = False Then
                      objSelection.EndKey
                      objSelection.Style = ActiveDocument.Styles("Heading 1")
                      objSelection.TypeText text:="Heading " + cell.Value
                      objSelection.TypeParagraph
                      objSelection.MoveLeft
                      objSelection.HomeKey Unit:=wdLine
                      objSelection.EndKey Unit:=wdLine, Extend:=wdExtend
                      objDoc.Bookmarks.Add Name:="BMrk" + CStr(o), Range:=objSelection
                      objSelection.Copy
                      ActiveSheet.Range("Q" + CStr(o)).Select
                             ActiveSheet.PasteSpecial Format:="Hyperlink", Link:=False, DisplayAsIcon _
                                     :=False
                      objSelection.MoveRight
  
                      'objSelection.Style = ActiveDocument.Styles("Paragraph")
                      objSelection.TypeText text:=Range(DescriptionCol + CStr(cell.Row)).Value
                      objSelection.TypeParagraph
                  End If
  
                  o = o + 1
  
              Next cell
  
  
          MyErrorHandler:
                  MsgBox "SeeHeadingPageNumber" &amp; vbCrLf &amp; vbCrLf &amp; "Err = " &amp; Err.Number &amp; vbCrLf &amp; "Description: " &amp; Err.Description
  </code></pre>
  
  <p>Additionaly, whatever exR range I define, it completes execution for the entire range but at the end MyErrorHandler is invoked. Is there a reason for it?</p>