View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Determine instances of Excel open

Hi all, I am would like to know if it is possible to detemine how many
instances of Excel are open. I know it is possible to check how many
workbooks, with the code below but i wouold like to check the number of
instances open, before closing the application.

Sub chkWkbToClosePo()
'
Dim wkb As Integer
Application.IgnoreRemoteRequests = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
wkb = Application.Workbooks.Count
If wkb <= 2 Then
Application.Quit
Else
ActiveWorkbook.Close
End If

End Sub

--
Les