如何检测Excel文件是否已经打开
现在用操作Excel,无法检测Excel文件是否已经打开,
哪位大神,帮忙看看!
谢谢!
2017-08-14 17:00
2017-09-13 16:30
2017-10-01 09:41
2017-10-04 00:00
程序代码:Dim i As Integer
Dim proc As Process()
'判断excel进程是否存在
If System.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
2017-10-05 18:03