title: Kill Excel after user close Userform
body: <p>We have tried to fix these problem for a couple of days and we posted on another forums but still no answer, may be you guys can help us here.</p>
  
  <p>I am having a problem with excel running after the Userform is closed, I think what I have supposed to end the application but it doesn't, it keeps excel running in the background and I have to end the process with task manager.
  I created a vba file to copy a file to the temp folder and run a macro which opens excel and the userform.
  Any help is appreciate it.</p>
  
  <p>This is the vba script that copy and opens the macro:</p>
  
  <pre><code>    Dim FSO 
      Set FSO = CreateObject("Scripting.FileSystemObject") 
      FSO.CopyFile "C:\pdfv6.xlsm", "C:\Windows\Temp\" 
      Set objExcel = CreateObject("Excel.Application") 
      objExcel.Application.Run "'C:\Windows\Temp\pdfv6.xlsm'!module1.macro1" 
      objExcel.DisplayAlerts = False 
      Set objExcel = Nothing
      objExcel.Application.Quit 
  </code></pre>
  
  <p>And this is part of the vba module:</p>
  
  <pre><code>    Sub Macro1() 
      Application.Visible = False 
      UserForm1.Show 
      End Sub
      Set objExcel = Nothing 
  </code></pre>
  
  <p>And this is the Sub that deals with closing the Userform and the application.</p>
  
  <pre><code>    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 
  If CloseMode = 0 Then 
      Unload Me
      ThisWorkbook.Close savechanges = False 
      Application.Quit 
      End 
    End If 
    End Sub 
  </code></pre>