Excel stays in TaskManager

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
 
J

Jim Burke in Novi

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top