title: VBA code stops after Documents.Open
body: <p>This Word VBA code stops after executing the statement before the 'STOPS HERE' comment.</p>
  
  <pre><code>Public Sub Test_Main()
  
      ' Open the Word file
      Dim sourceDocPath As String
      sourceDocPath = ThisDocument.Path &amp; "\TestDoc.docx"
      Dim sourceDoc As Document
      Set sourceDoc = Documents.Open(sourceDocPath, ReadOnly:=True)
      ' !!!! STOPS HERE !!!!
  
      MsgBox "GOOOOOOOOOOOOOOOOOOOOOAAAAAAAAAAAALLLL!!!"
  
      Set sourceDoc = Nothing
  
      End
  
  End Sub
  </code></pre>
  
  <p>• The specified Word file opens by the statement before the stop point.<br>
  • There's no error messages. It just stops after opening the file.<br>
  • When run from its own "Document_Open" of the Word macro, the "Test_Main" runs ok to the end. It stops when run directly from "Developer > Macros".<br>
  • "Set object = nothing" didn't solve the problem. <br>
  • "End" statement didn't solve the problem.<br>
  • Please place "TestDoc.docx" in the same directly as the test Word macro. It can be empty.<br>
  • The environment is Office 365 &amp; Windows 10 64 bit.</p>
  
  <p>If anyone has experienced the same kind of problems or knows how to solve the problem, please let me know!</p>