Excel stays in TaskManager

  • Thread starter Thread starter Ray C
  • Start date Start date
R

Ray C

I have the following code, that when it finishes executing, Excel remains in
the TaskManager.
However, when I remove the line that sets the objBook variable, Excel
disappears from the task manager. My question is this...Am I setting the
workbook improperly?

I tried putting "Set objBook=Nothing" right before I set objExcel to
nothing, but Excel still remains in the task manager as well.

Dim objExcel As Excel.Application
Dim objBook As Excel.Workbook

Set objExcel = New Excel.Application
objExcel.Visible = True
Set objBook = objExcel.Workbooks.Add

objExcel.Quit
Set objExcel = Nothing
 
From the code you have there, it looks like you're opening a new workbook and
then the user is manipulating that workbook. If that's the case, the user
should be saving the workbook and closing Excel themselves, so you shouldn't
have to do it in your code. If that's not the case then I'm not sure what
you're doing exactly. You have no code to do anything in Excel other than
open the application and create a new workbook. What exactly are you trying
to accomplish?
 
Back
Top