title: Linked file do not close unless the application is closed
body: <p>I have a problem that turn my head for more than three days now, the problem is that I am using a data-entry app using vba , I have linked some other excel workbooks to my database entry and when I open those linked files from the list box of my app: they open normally but they do not wanna close unless I close my app (and all the excel workbooks are closed), if any one can help me I would be gratfule. here is my vba:</p>
  <pre><code>`Private Sub cmbfichedevie_Click()
  Dim sh As Worksheet
  Set sh = ThisWorkbook.Sheets(&quot;Database&quot;)
  Set shsearch = ThisWorkbook.Sheets(&quot;Searchdata&quot;)
  Dim iRow As Long
  Dim iRowsearchdat As Long
  Dim ttt As Long
  
  With shsearch
  ttt = Selected_list + 1
  iRowsearchdata = [Counta(Searchdata!A:A)]
  If iRowsearchdata &gt; 1 Then
      If Selected_list &gt;= iRowsearchdata Or Selected_list = 0 Then
      MsgBox &quot;Aucun élément n'est sélectionné.&quot;, vbOKOnly + vbInformation, &quot;Ouvrir&quot;
      Else
          If shsearch.Cells(ttt, 12) = &quot;&quot; Or shsearch.Cells(ttt, 12) = &quot;No file&quot; Then
          MsgBox &quot;Il n'y a aucune fiche de vie pour cet article.&quot;, vbOKOnly + vbInformation, &quot;Ouvrir&quot;
          Else
          'shsearch.Cells(ttt, 12).Hyperlinks(1).Follow
          Workbooks.Open .Cells(ttt, 12)
          'Unload Me
          End If
      End If
      Exit Sub
  Else
  With sh
  ttt = Selected_list + 1
  iRow = [Counta(Database!A:A)]
  
  If Selected_list &gt;= iRow Or Selected_list = 0 Then
  MsgBox &quot;Aucun élément n'est sélectionné.&quot;, vbOKOnly + vbInformation, &quot;Ouvrir&quot;
  Else
  
      If sh.Cells(ttt, 12) = &quot;&quot; Or sh.Cells(ttt, 12) = &quot;No file&quot; Then
      MsgBox &quot;Il n'y a aucune fiche de vie pour cet article.&quot;, vbOKOnly + vbInformation, &quot;Ouvrir&quot;
      Else
      'sh.Cells(ttt, 12).Hyperlinks(1).Follow NewWindow:=True
      Workbooks.Open .Cells(ttt, 12)
      'Unload Me
      End If
  End If
  End With
  End If
  End With
  End Sub
  </code></pre>
  <p>`</p>