Dim i As Integer Dim proc As Process() '判断excel进程是否存在 If Sy
stem.Diagnostics.Process.GetProcessesByName("excel").Length > 0 Then proc = Process.GetProcessesByName("excel") '得到名为excel进程个数,全部
关闭 For i=0 to proc.Length -1 proc(i).Kill() Next End If proc =
nothing