The code i am using below runs fine the first time and produces the document i need. The second time it runs i am getting a runtime error 462 - the remote server machine does not exist or is not available. i get this error on the following line of code:

Code:
objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Width = CentimetersToPoints(23.5)
- in the format MIMT PAGE Section of the code.

i think the reason for the error is because an instance of word is not closed from when the code was last run but i can find out what it is. the full code is below.

Code:
  Dim objWordApp As Object
        Dim objWordDoc As Object

        'Get pointer to Word Object
        Set objWordApp = Nothing
        Set objWordApp = CreateObject("Word.Application")

        'Open the document
        Set objWordDoc = Nothing
        Set objWordDoc = objWordApp.Documents.Open("\\FS03\DBBackend\EO Database\Template\Board Pack.Docx")


        'Make Word Instance visible
        objWordApp.ScreenUpdating = True
        objWordApp.Visible = True
        
        '**********  FORMAT MIMT PAGE  **********
        
        Dim strBMName As String
        Dim objBMRange As Object
        'Select Excel Sheet
        oXLApp.Sheets("MIMT").Select

        strBMName = "MIMT"
        Set objBMRange = objWordDoc.Bookmarks(strBMName).Range
        
        'Select and Copy Data
        oXLApp.Range("A4:I40").Select
        oXLApp.Selection.CopyPicture
        
        'Goto Bookmark, Paste and Format Size of image
        objWordApp.Selection.Goto What:=wdGoToBookmark, Name:=strBMName
        objWordApp.Selection.Paste

        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).LockAspectRatio = msoFalse
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Width = CentimetersToPoints(23.5)
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Height = CentimetersToPoints(16.5)
        objWordApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        
        'Reset Variable
        Set objBMRange = Nothing
  
        '**********  FORMAT MIMT DASHBOARD PAGE  **********
        'Select Excel Sheet
        oXLApp.Sheets("MIMT Dashboard").Select
        
        strBMName = "MIMTDASH"
        Set objBMRange = objWordDoc.Bookmarks(strBMName).Range
        
        'Select and Copy Data
        ActiveSheet.Range("A2:T53").Select
        oXLApp.Selection.CopyPicture
        
        'Goto Bookmark, Paste and Format Size of image
        objWordApp.Selection.Goto What:=wdGoToBookmark, Name:=strBMName
        objWordApp.Selection.Paste
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).LockAspectRatio = msoFalse
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Width = CentimetersToPoints(25.7)
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Height = CentimetersToPoints(16.7)
        objWordApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        
        'Reset Variable
        Set objBMRange = Nothing
  
                
  
        '**********  FORMAT KPI PAGE  **********
        Set objExcelApp1 = CreateObject("Excel.Application")
        
        'Make Word Instance visible
        objExcelApp1.ScreenUpdating = False
        objExcelApp1.Visible = True
        
        'MsgBox "You are about to be prompted to select the file required for the KPI Information", vbInformation, "KPI Data"
        objExcelApp1.Visible = msoTrue
        'Select Excel Sheet
        With objExcelApp1.FileDialog(msoFileDialogFilePicker)
            .AllowMultiSelect = False
            .Title = "Select the KPI Document File that you want to insert"
            .Show
            FileToInsert = .SelectedItems(1)
        End With

        ' get content from my file

        strBMName = "KPI"
        Set objBMRange = objWordDoc.Bookmarks(strBMName).Range
        
        'Select and Copy Data
        'Open the document
        objExcelApp1.Workbooks.Open (FileToInsert)
        objExcelApp1.Range("A1").Select

        Set rngTemp = objExcelApp1.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
        If Not rngTemp Is Nothing Then
            objExcelApp1.Range(objExcelApp1.Cells(1, 1), rngTemp).Select
        End If
        
        objExcelApp1.Selection.CopyPicture
        objExcelApp1.ActiveWindow.Close
        
        'Goto Bookmark, Paste and Format size of Image
        objWordApp.Selection.Goto What:=wdGoToBookmark, Name:=strBMName
        objWordApp.Selection.Paste
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).LockAspectRatio = msoFalse
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Width = CentimetersToPoints(21.7)
        objWordDoc.InlineShapes.Item(objWordDoc.InlineShapes.Count).Height = CentimetersToPoints(16.7)
        objWordApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        objWordApp.ScreenUpdating = True
        ActiveDocument.TablesOfContents(1).Update
        
        objExcelApp1.Quit
        Set objExcelApp1 = Nothing
        
        'Reset Veriable
        Set objBMRange = Nothing
        
 
        Form.SetFocus
        AppActivate ("Microsoft Access")
        If MsgBox("Would you like to save a copy of the Board Pack Document", vbYesNo, "Board Pack Save as document") = vbYes Then
            
        objWordApp.Visible = msoTrue        'Save the document
       
        With objWordApp.FileDialog(msoFileDialogSaveAs)
            .Title = .Title & "File to SaveAs"
            .InitialFileName = strStart
            .AllowMultiSelect = False
           '.Filters.Add " Files", "*.pdf"
            .InitialView = msoFileDialogViewDetails
            .Show
            .Execute
        End With
        Else
            objWordApp.Visible = msoTrue
        End If
        
        End Select
        
        
        
        
        oXLApp.Quit
        

        Set oXLApp = Nothing
        objWordApp.Quit
        Set objWordApp = Nothing
        Set objWordDoc = Nothing
        'Set objWordApp1 = Nothing
        'objExcelApp.Quit
        Set objExcelApp = Nothing
        'objExcelApp1.Quit
        Set objExcelApp1 = Nothing
        
        Set oXLBook = Nothing
        Set oXLSheet = Nothing
Can anyone help?
Thanks