Determine instances of Excel open
Funny, I am trying to force a second instance but found how to count
instances open. The authors name is Jennifer
'======
Sub ExcelInstances() 'Office discussion Groups author: Jennifer
Dim XLCount
Dim oWMI
Set oWMI = GetObject("winmgmts:")
XLCount = 0
For Each Process In oWMI.InstancesOf("Win32_Process")
If UCase(Process.Name) = "EXCEL.EXE" Then
XLCount = XLCount + 1
End If
Next
MsgBox "Excel Instances Open: " & XLCount
Set oWMI = Nothing
End Sub
'======
--
Regards
XP Pro
Office 2007
|