+ Reply to Thread
Results 1 to 2 of 2

Get info from running Excel instance

  1. #1
    Tod
    Guest

    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


  2. #2
    Rowan
    Guest

    RE: 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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1