ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get info from running Excel instance (https://www.excelbanter.com/excel-programming/338225-get-info-running-excel-instance.html)

tod

Get info from running Excel instance
 
Is there a vba or vb solution to getting information about open
instances of Excel? For example, I have an instance of Excel open,
viewing it from the Task Manager. It's not visible so I don't know what
it is or what workbook it might have open, etc. Is there a way (API or
other) that I can say 'give me the scoop on this open instance of
Excel'?

tod


Rowan[_2_]

Get info from running Excel instance
 
This is VB script to find invisible instances of Excel. It should make the
instance visible so you can then see what it is and close it.

' XLcheck.vbs
' Find an invisible instance of Excel

Dim objXL, strMessage

On Error Resume Next

' Try to grab a running instance of Excel:
Set objXL = GetObject(, "Excel.Application")

' What have we found?
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If

' Feedback to user...
MsgBox strMessage, vbInformation, "Excel Status"

' Make it show so we can kill it
if strMessage = "Excel Running." then objXL.Visible = true

' End of VBS code

Hope this helps
Rowan

"Tod" wrote:

Is there a vba or vb solution to getting information about open
instances of Excel? For example, I have an instance of Excel open,
viewing it from the Task Manager. It's not visible so I don't know what
it is or what workbook it might have open, etc. Is there a way (API or
other) that I can say 'give me the scoop on this open instance of
Excel'?

tod




All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com