You want to terminate a Process in your VB.NET program. This may be because you want to ensure a certain program is not running. With the Kill subroutine you can force a Process to terminate immediately.

This simple program starts the "notepad" executable, which you are familiar with; it uses the Process.Start function for this. Next, it sleeps for one entire second to make the program easier to understand. Finally, it demonstrates the Kill method. At this point, the "notepad" process is no longer running.
Process.Start Examples Sleep MethodThis VB example program shows how to use the Kill Sub on Process.
Program that uses Kill [VB.NET]
Module Module1
Sub Main()
' Start the notepad.exe Process.
Dim p As Process = Process.Start("notepad")
Console.WriteLine("Started")
' Sleep for one second.
Threading.Thread.Sleep(1000)
' Terminate.
p.Kill()
Console.WriteLine("Killed")
End Sub
End Module
Result
1. Notepad is started.
2. One second passes.
3. Notepad is killed.
The Kill subroutine on the Process instance in your VB.NET program can be used to terminate the Process. This can be used whenever you want to ensure a certain program (such as Excel) is no longer running. You can then proceed to modify files that might have been in use by that process.
VB.NET Tutorials