Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows taskmanager

Status
Not open for further replies.

Bvisual

Programmer
Jul 1, 2005
35
BE
Hello there

I am creating a excel file with vb.net but sometimes (not always !) the excel.exe process will stay open (sometimes even more then ones). Is there a code to remove all the excel.exe out off the taskmanager.


more ?

whats the code to merge cells in a excelfile using vb
whats the code to adjust kollomwith with vb


thx
 
If you have application.Quit at the end of the routine, it should be closing it. However, you can use this code to close all running instances!
Code:
Dim myProcess() As Process
Dim instances As Process
myProcess = Process.GetProcessesByName("Excel")
For Each instances In myProcess
     instances.CloseMainWindow()
Next

Maybe this world is another planet’s Hell.
 
Someone whould write a book entitled: "The Joys of Office Libraries." with a picture of someone beating their head against a wall on the cover.

Anyways. Make sure you close everything in excel in the correct order. And remember, Excel creates 3 worksheets by default as soon as you create a workbook.

So, make sure you close ALL of the worksheets, the workbook, then the app.

Then set the variables = to nothing.

Then call GC.Collect2()

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top