Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Identifying Excel Application/Workbook on Server (03)

    Is it possible to identify an Excel file that is open on a server. I log on to the server by using terminal services and can see that there is an instance of Excel running in the Task Manager>Processes. Other than seeing the Excel process still running, I can not visually see file being used.

    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Identifying Excel Application/Workbook on Server (03)

    I have no experience with terminal services, but perhaps you can use the following code. It can be run from another Office application, such as Word.

    Sub ListWorkbooks()
    Dim xl As Object
    Dim i As Integer
    Dim strList As String
    On Error Resume Next
    Set xl = GetObject(, "Excel.Application")
    If xl Is Nothing Then
    MsgBox "Excel is not running.", vbInformation
    Exit Sub
    End If
    On Error GoTo ErrHandler
    For i = 1 To xl.Workbooks.Count
    strList = vbCrLf & xl.Workbooks(i).FullName
    Next i
    If strList = "" Then
    MsgBox "No workbooks open.", vbInformation
    Else
    MsgBox "Open workbooks: " & vbCrLf & strList
    End If
    ExitHandler:
    Set xl = Nothing
    Exit Sub
    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Identifying Excel Application/Workbook on Server (03)

    Hans,

    Thanks for the code. I have tried it within Word and unfortuantely it does not detect the Excel application. Based on the code provided I receive the message box response "Excel is not running".

    I can see that Excel is indeed running via the task manager.

    Still puzzled.
    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Identifying Excel Application/Workbook on Server (03)

    Processes on terminal services apparently work differently. I have no experience with terminal services, so I can't offer further help. Sorry.

Posting Permissions

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