Sub InstanceCount()
Dim objList As Object, objType As Object, strObj$
strObj = "Powerpnt.exe"
Set objType = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='" & strObj & "'")
If objType.Count > 1 Then
MsgBox objType.Count & " Excel instances are running on your system.", , "More than one instance"
Else
MsgBox "Only this instance is running on your system.", , "One and done"
End If
End Sub
I have got this from searching the board,
Code:Sub InstanceCount() Dim objList As Object, objType As Object, strObj$ strObj = "Powerpnt.exe" Set objType = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='" & strObj & "'") If objType.Count > 1 Then MsgBox objType.Count & " Excel instances are running on your system.", , "More than one instance" Else MsgBox "Only this instance is running on your system.", , "One and done" End If End Sub
this checks, if Powerpoint is open, and counts the instances,
how can I modify this to return the file name to a cell,
assuming that there would be only one PPT open at any point in time
Sub StartOtherApp()
Dim ppApp As PowerPoint.Application, IStartedPP As Boolean
On Error Resume Next
Set ppApp = GetObject(, "powerpoint.application")
On Error GoTo 0
If ppApp Is Nothing Then
IStartedPP = True
Set ppApp = CreateObject("powerpoint.application")
End If
ppApp.Open "D:\Documents and Settings\sankaranarayanan ven\My Documents\san\my\test\Intake Report_AUO.ppt"
' If IStartedPP Then
' ppApp.Quit
' End If
' Set ppApp = Nothing
End Sub