Killing Excel after tool execution

Killing Excel after tool execution

Anonymous
Not applicable
318 Views
7 Replies
Message 1 of 8

Killing Excel after tool execution

Anonymous
Not applicable
Hi all,

Attached is a small program that creates an Excel file.
The problem with this program is- the EXCEL does not get killed after the program execution, which can be seen in the Process list of Task Manager.

The attachment contains the VB source program, it's EXE file and a GIF showing the living EXCEL in TaskManager.
Please execute the EXE with TaskManager open and feel the problem.

What changes should I make in the program to solve this problem? Any suggestions most appreciated.

Thanks,

MNRaghu
0 Likes
319 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Search the group as this has been covered multiple times.

G'Luck

Bob Coward
0 Likes
Message 3 of 8

Anonymous
Not applicable
set excel = nothing

--
Matt W
"What the flip was Grandma doing at the sand dunes?"
0 Likes
Message 4 of 8

Anonymous
Not applicable
xlApp.Quit

Set xlApp = Nothing
Set xlSheet = Nothing
Set xlWbk = Nothing

You must Set each object to Nothing in the EXACT reverse order of their
creation.

wrote in message news:5193461@discussion.autodesk.com...
Hi all,

Attached is a small program that creates an Excel file.
The problem with this program is- the EXCEL does not get killed after the
program execution, which can be seen in the Process list of Task Manager.

The attachment contains the VB source program, it's EXE file and a GIF
showing the living EXCEL in TaskManager.
Please execute the EXE with TaskManager open and feel the problem.

What changes should I make in the program to solve this problem? Any
suggestions most appreciated.


Thanks,

MNRaghu
0 Likes
Message 5 of 8

Anonymous
Not applicable
Jeff Mishier,

That did the trick. Thanks.

Bob Coward and Matt,

Thanks you too for the replies.
(Matt - Your suggestion gave error.)

MNRaghu
0 Likes
Message 6 of 8

Anonymous
Not applicable
I didn't open the ZIP file so I don't know EXACTLY what you wrote or what your variables were. I was just thinking back to a
previous program that I wrote a while back which extracts attributes to Excel and counts/totals them.

I completely forgot about the reverse order thing that Jeff had mentioned.

Glad you got it working though.

--
Matt W
"What the flip was Grandma doing at the sand dunes?"
0 Likes
Message 7 of 8

Aubelec
Explorer
Explorer
hello.
easy : do not use the function range. use only cell(x,y) the objet range create a pointer (one selection) but when you quit excel. the pointer is not release --> excel do not quit.
and use only a var for all your app; in excel. for use a selection cell. :
set selec = excelpage.cell(x,y)
selec.value = "rrrr"

do not try this : excelpage.cell(x,y).value = "rrr"
with this you do not release the selection. is hard to earn but with the trick excel quit properly.
0 Likes
Message 8 of 8

Anonymous
Not applicable
Aubelec,

Thanks for the nice tip.

MNRaghu
0 Likes