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
    1. Public Enum ExternalRef
    2. Worksheet
    3. Workbook
    4. Application
    5. 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.

  • 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
    1. Public Enum ExternalRef
    2. Worksheet
    3. Workbook
    4. Application <== This guy right here, Does this have to be an object for the program to fulfill its intended purpose?
    5. 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 ().