Dim MyXL As Object On Error Resume Next Set MyXL = GetObject(, "Excel.Application") If Err = 0 Then Debug.Print MyXL.Workbooks(1).FullName If LCase(MyXL.Workbooks(1).FullName) = "e:\iii.xls" Then MsgBox "工作薄已打开。" End If End If Set MyXL = Nothing 试试看吧
用ZwQuerySystemInformation+NtQueryObject可以完成
Dim MyXL As Object
On Error Resume Next
Set MyXL = GetObject(, "Excel.Application")
If Err = 0 Then
Debug.Print MyXL.Workbooks(1).FullName
If LCase(MyXL.Workbooks(1).FullName) = "e:\iii.xls" Then
MsgBox "工作薄已打开。"
End If
End If
Set MyXL = Nothing
试试看吧