title: VBA open workbook, exits code
body: <p>I try to open a workbook of the type '.xlsm' using </p>
  
  <pre><code>Private Function readFiles(ByVal lv_path As String, ByRef lx_wrkShDes As Worksheet)
      'On Error GoTo ErrorHandling
      Dim lx_objectExcel As New Excel.Application
      Dim lx_wrkBkSrc As Workbook
      Dim lx_wrkShSrc As Worksheet
      Dim lx_shrPathObj As Object
      Dim lv_shrPath As String
  
      Set lx_shrPathObj = CreateObject("scripting.filesystemobject")
      lv_shrPath = Replace(lx_shrPathObj.GetFile(lv_path).ShortPath, mv_longFilePathHelper, "")
      Set lx_wrkBkSrc = Workbooks.Open(Filename:=lv_shrPath, ReadOnly:=True)
      'Using lx_objectExcel.Workbooks.Open WORKS but not Workbooks.Open 
      'lx_objectExcel.Workbooks.Open(Filename:=lv_shrPath, ReadOnly:=True)
      If Not Library.DoesSheetExist(lx_wrkBkSrc, mv_workSheetName) Then
          GoTo ErrorHandling
      End If
      Set lx_wrkShSrc = lx_wrkBkSrc.Sheets(mv_workSheetName)
  
  
      'Rest of the function
  
  End Function    
  </code></pre>
  
  <p>It opens the workbook and exits the VBA code immediately.
  I tried this <a href="https://support.microsoft.com/en-us/help/555263" rel="nofollow noreferrer">https://support.microsoft.com/en-us/help/555263</a>, but same results.</p>
  
  <p>It does not exit if I use new instance of Excel using</p>
  
  <pre><code>lx_objectExcel.Workbook.open('path')
  </code></pre>
  
  <p>I do not want to use a new instance as paste special is not suitable with new instance and opening 100s of Workbooks this way consumes lot of time.</p>