closing excel

M

Mark

Hi all,

as many had, i have some problems terminating the excel-process.
I implemented the solutions i found in this forums. Tried most
combinations of them ;-).
It still doesn't work.

I'll post my code-snippets below. I hope u can shine some light on the
solution.

Thx,

Mark

<code>
Dim excelApp As Excel.Application = New Excel.Application
Dim excelWorkbook As Excel.Workbook
Dim excelSheetInput As Excel.Worksheet
Dim excelSheetOutput As Excel.Worksheet

<doin sumthing>

Finally
excelSheetInput = Nothing
ReleaseCOMObject(excelSheetInput)
excelSheetOutput = Nothing
ReleaseCOMObject(excelSheetOutput)
'excelWorkbook.Close()
excelWorkbook = Nothing
ReleaseCOMObject(excelWorkbook)
excelApp.Quit()
excelApp = Nothing
ReleaseCOMObject(excelApp)
System.GC.Collect()
End Try
</code>
<code>
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(pobj)
Catch
Finally
pobj = Nothing
End Try
</code>
 
M

Mark

Ty for your response.
I solved, thx to other sources, by specificly use variables for all
objects used in the process (sheets-collection etc.) and placing the
close- quit and terminate-statements in the rite order.

I will study the article u r referring too.
Maybe i will find some good arguments which i can use to convince my
client not to use Excel. They kinda insist at the mo in using Excel
(hey it works fine with j2ee too).

Grtz,

Mark
 

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

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top