Hey,
ich bin auf der suche nach einem Befehl der ermittelt ob Excel wieder geschlossen wurde.
Ich möchte eine bestimmte Aktion ausführen, wenn der Benutzer Excel wieder schließt und dazu muss ich herausfinden wann Excel wieder geschlossen wurde.
Die Excel Liste habe ich natürlich vorher mit CoMatePlus geöffnet.
Gibts da Möglichkeiten?
Gruß Joel
CoMatePlus Excel Closed?
CoMatePlus Excel Closed?
----------------------------------------------------------
PB 5.20 Beta 10 | Windows 7
PB 5.20 Beta 10 | Windows 7
Re: CoMatePlus Excel Closed?
Im Prinzip geht das doch per WMI, so das einfache und sicher ausbaufähiges Beispiel hier:
Code: Alles auswählen
XIncludeFile "COMatePLUS.pbi"
Procedure Get_task(name_task.s)
Protected objWMIService.COMateObject, task.COMateObject
Protected tasklist.COMateEnumObject
strComputer.s = "."
objWMIService = COMate_GetObject("winmgmts:\\" + strComputer + "\root\cimv2", "")
If objWMIService
tasklist = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_Process')")
If tasklist
task = tasklist\GetNextObject()
While task
If task\GetStringProperty("Name") = name_task
Global id.i= task\GetIntegerProperty("ProcessId")
EndIf
task\Release()
task = tasklist\GetNextObject()
Wend
tasklist\Release()
EndIf
objWMIService\Release()
EndIf
EndProcedure
Get_task("excel.exe")
Debug id