Listing all instances of excel

  • cytop has some excellent code here: List all open workbooks in all instances of Excel.



    However there is one snag

    The piece of code:


    Code
    Public Enum ExternalRef
    Worksheet
    Workbook
    Application
    End Enum

    interferes wit any Application function, such as Application.ScreenUpdating = False. I get an error, invalid qualifier, which of course it is. Any suggestions on how to get around this.

    Edited once, last by royUK: Add code tags ().

  • I don't know if this fixes the problem or not. I am not familiar with Enum and what it does.


    Online 38, change Application to ApplicInstance


    Then on line 78 change ExternalRef.Application to ExternalRef.ApplicInstance

    Then online 122 change oWhich = Application to oWhich = ApplicInstance



    Could somebody confirm if this is correct. Does the Enum statement beginning online 35 have to contain objects

    Code
    Public Enum ExternalRef
    Worksheet
    Workbook
    Application  <== This guy right here, Does this have to be an object for the program to fulfill its intended purpose?
    End Enum


    If someone could elaborate on this it would be appreciated.


    Thanks

    Edited 2 times, last by royUK: Add code tags, please read the Forum Rules to understand why ().

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!