Dim objXL, strMessage
On Error Resume Next
Set objXl = GetObject(, "Excel.Application")
If Not TypeName(objXL) = "Empty" then
strMessage = "Excel Running"
Else
strMessage = "Excel NOT Running"
End If
MsgBox strMessage, vbInformation, "Excel Status"
Hey thanks alot buddy. This really brings me close to what am looking for, moving much closer to the solution. Let me tell you my exact requirement/issue: Actually my issue is that, from Java I am trying to find Excel instance with a particular workbook name but am not returned an Excel instance even though it appears. In my case I have an Excel opened with 2 workbooks "Book1" and "Book2" in it. When am trying to find Excel with any of these workbook name, am given no result. To narrow down, this issue is observed only on one of my client machines. On rest machines this same java code working fine. This started happening after uninstalling Excel2010 and installing Excel2007.
So what I am trying to do is that, want to create one vbscript where I can give the workbookname as an input and it will return me whether there is such Excel instance running with given workbook name.
Hey please guide me further towards creating such script where I will give the workbook name and script will find whether such Excel instance is running or not. Not an issue even if workbook name is passed as an hardcoded input in script. I will alter as per my workbook name.
Thanks for your previous reply and awaiting for this one too.. :))