Same result in Office 2003.
I used code as modified below:
Option Explicit
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd
As Long, lpdwProcessId As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Public Sub MultiplePowerpointsHandles()
Dim appPowerpoint As Powerpoint.Application
Dim appPowerpointAnother As Powerpoint.Application
Dim appWord As Word.Application
Dim blnPPTRunning As Boolean
Dim lngHandle1 As Long
Dim lngHandle2 As Long
Dim lngHandleWord As Long
Dim lngPID1 As Long
Dim lngPID2 As Long
lngHandleWord = GetForegroundWindow()
On Error Resume Next
Set appPowerpoint = GetObject(Class:="PowerPoint.Application")
If appPowerpoint Is Nothing Then
' Powerpoint not running, create instance of Powerpoint
blnPPTRunning = False
Err.Clear
Set appPowerpoint = New Powerpoint.Application
MsgBox "Creating first instance of Powerpoint", vbOKOnly, _
"Powerpoint was not already running"
Else
blnPPTRunning = True
MsgBox "Using running instance of Powerpoint", vbOKOnly, "Powerpoint
was already running"
End If
With appPowerpoint
.Visible = True
.Activate
lngHandle1 = GetForegroundWindow()
.WindowState = ppWindowMinimized
End With
' Create another instance of Powerpoint
Set appPowerpointAnother = New Powerpoint.Application
If appPowerpointAnother Is Nothing Then
With Err
MsgBox .Number & ": " & .Description, vbOKOnly, "Could not
create second instance of Powerpoint"
End With
Else
MsgBox "OK!", vbOKOnly, "Created second instance of Powerpoint"
With appPowerpointAnother
.Visible = True
.Activate
lngHandle2 = GetForegroundWindow()
.WindowState = ppWindowMinimized
End With
'Check processes IDs
GetWindowThreadProcessId lngHandle1, lngPID1
GetWindowThreadProcessId lngHandle2, lngPID2
If lngPID1 = lngPID2 Then
MsgBox "Both instances of Powerpoint use the same process.",
vbOKOnly, _
"Powerpoint"
Else
MsgBox "Each instance of Powerpoint uses a different
process.", vbOKOnly, _
"Powerpoint"
End If
If vbYes = MsgBox("Select Yes to kill the second instance of
Powerpoint", vbYesNo, _
"Powerpoint hit squad needs your instructions") Then
appPowerpointAnother.Quit
End If
End If
'If this code started PowerPoint
If blnPPTRunning = False Then
If vbYes = MsgBox("Select Yes to kill the First instance of
Powerpoint", vbYesNo, _
"Powerpoint hit squad needs your instructions") Then
appPowerpoint.Quit
End If
End If
' Create another instance of Word
Set appWord = New Word.Application
If appWord Is Nothing Then
With Err
MsgBox .Number & ": " & .Description, vbOKOnly, "Could not
create second instance of Word"
End With
Else
MsgBox "OK!", vbOKOnly, "Created second instance of Word"
With appWord
.Visible = True
.Activate
lngHandle2 = GetForegroundWindow()
.WindowState = wdWindowStateMinimize
'Check processes IDs
GetWindowThreadProcessId lngHandleWord, lngPID1
GetWindowThreadProcessId lngHandle2, lngPID2
If lngPID1 = lngPID2 Then
MsgBox "Both instances of Word use the same process.",
vbOKOnly, _
"Word"
Else
MsgBox "Each instance of Word uses a different process.",
vbOKOnly, _
"Word"
End If
.Quit
End With
End If
Set appPowerpoint = Nothing
Set appPowerpointAnother = Nothing
Set appWord = Nothing
End Sub