Results 1 to 6 of 6

Thread: Running into Error 462: The remote server machine does not exist
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2015
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Running into Error 462: The remote server machine does not exist

    Hey guys, I have a macro where it saves a word file; however, it won't always run, everyone once in awhile it throws the error 462: The remote server machine does not exist. or it'll throw an error saying can't find active document. it will work through once I go to the task manager and close out any orphaned Word processes. Does anyone know what I can add to my code to not have any orphaned Word processes, or if there are some, to clear them out? I thought by closing out my macro by setting wordapp to nothing and quitting Word would do it but it does not fix it.

    Thanks,

    Sub Save_Narrative() 'This Saves the Narrative as a word file and as a PDF in a designated folder
    Dim wordApp As Word.Application
    Dim wordDoc As Word.document
    Dim DocName As String
    Dim NewdocName As String




    Set wordApp = Nothing

    Set wordApp = CreateObject("Word.Application")


    Set wordDoc = ActiveDocument


    DocName = wordDoc.Name




    'Save as word file
    wordDoc.SaveAs FileName:=([redacted])


    'remove .docx from file name
    NewdocName = Left(DocName, Len(DocName) - 5) & ".pdf"


    'save as PDF
    wordDoc.SaveAs FileName:=([redacted]), FileFormat:=17




    wordDoc.Close SaveChanges:=False
    Set wordDoc = Nothing
    wordApp.Quit
    Set wordApp = Nothing



    End Sub

  2. #2
    New Member
    Join Date
    Aug 2015
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Running into Error 462: The remote server machine does not exist

    Also I will note that using ActiveDocument script instead of naming it was on purpose as the document is pulled from a web based application.

  3. #3
    New Member
    Join Date
    Aug 2015
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Running into Error 462: The remote server machine does not exist

    No thoughts?

  4. #4
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    16,473
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Running into Error 462: The remote server machine does not exist

    I'm not sure I see what the use of the new "WordApp" is. It looks like you create it, do some work (not using it - using whatever is running the code), then destroy it.

    It's also possible that the reason it works after you remove orphaned processes isn't directly related to the orphaned processes. Hard to say though. You would still want to remove orphaned processes but there's probably more to this than just this macro.

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  5. #5
    New Member
    Join Date
    Aug 2015
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Running into Error 462: The remote server machine does not exist

    Yes, to explain the purpose a little better. I download from a company based web application that has cases we are working on. we go through several a day. we edit these cases and then save them as a word doc and PDF. rather than having to manually save the files every case I do, I wrote this macro to do all the saving for me. I just can't figure out why it won't run every time. If it runs just fine the first time, then the second time I get the error. then if I close out the word process in task manager and run again it runs just fine. Hopefully that helps clarify a bit more

  6. #6
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    16,473
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Running into Error 462: The remote server machine does not exist

    It's hard to say. Something crucial here would be the filenaming (since you can't save files with the same name). But that logic is hidden/obscured. Also not clear where/how this is being run (in a script, from Excel, from Word, in a personal word or excel macroworkbook, in some other kind of excel or word workbook. Also since the error message refers to remote machines it isn't clear if you are actually working with remote machines (?) or not. A lot of unknowns.

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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