This is what I use to detect Excel:
Dim xlApp As excel.Application
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
If Err.Number = 429 Then 'Excel not running
Set xlApp = CreateObject("Excel.Application")
End If
On Error GoTo 0
after installing xlApp, you can use xlApp.Workbooks.Countto count worksheets
Note. This code will open first if there is more than one instance of Excel to search
, , Set xlApp = GetObject("Book2").Application , . , book2 - - ,
: http://msdn.microsoft.com/en-us/library/aa164798%28v=office.10%29.aspx