Set powerPointProcessList = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='POWERPNT.EXE'")

' Check if PowerPoint is running
If powerPointProcessList.Count > 0 Then
	Set application = WScript.CreateObject("PowerPoint.Application")
	' Check if any files are open
	If application.Presentations.Count < 1 Then
		Call Err.Raise(60002, , "Not open any presentation file")
	End If
Else
	Call Err.Raise(60001, , "PowerPoint not running")
End If