This method will end or
kill all the Excel files which is currently in taskmanger
Public Sub KillExcel()
Try
Dim
lstProcess As New
List(Of Process)
lstProcess = Process.GetProcessesByName("EXCEL").ToList()
lstProcess = lstProcess.Where(Function(P) P.MainWindowTitle = String.Empty).Select(Function(P)
P).ToList()
For
Each pr As Process In
lstProcess
pr.Kill()
Next
Catch
ex As Exception
MessageBox.Show("Error on Killing Process")
End Try
End Sub
I
hope this article will be very helpful to all. Thanks for reading this article.
“Keep reading and share the knowledge”
“Grow more trees to save
the Earth”
Is there a way to terminate a specific excel instance running in Taskmanager. eg. by the name of the excel file ? Glenn
ReplyDelete