Consulting

Results 1 to 5 of 5

Thread: Can you tell if a open book has this workbook as a reference

  1. #1

    Can you tell if a open book has this workbook as a reference

    Hi,

    I have a xls file with central code I use in a number of books and I'm looking for a way to check if a open workbook is referencing the code.
    I need to do this in the code book not the book thats referencing it.

    any ideas???

  2. #2
    By the way if more information is needed just ask me.

    The project is referenced in another project and the referenced project needs to be able to tell if the project that referres to it is open. (hope that makes sense)

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    [VBA]If ActiveWorkbook.Name<>ThisWorkbook.Name then MsgBox "Oops"[/VBA]

  4. #4
    Thanks Kennith but this is not what I mean.

    Say my project is Book1.xls or Book2.xls or any workbook for that matter.
    It has a reference to Code1.xls workbook in the project throught Tools>References
    Ineed to be able to check in a macro in Code1.xls if a book1.xls is open and reverencing this Code1.xls workbook,

    There are unlimited possible variations on book1.xls that reference Code1.xls

    does this make sense??

    regards,

  5. #5
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    You want to check the references for each open workbook? If so, then you can iterate the workbooks collection and use VBProject.References. A search for it at this site will provide examples. Another link that you can review is: http://www.excelkb.com/default.aspx?...&pNodes=0U2O7J

Posting Permissions

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