Consulting

Results 1 to 5 of 5

Thread: ?Can?t Find Project or Library?

  1. #1

    ?Can?t Find Project or Library?

    I am really in a panic. All of a sudden I get the following message when I open most of my workbooks:
    ?Compiler error
    Can?t find project or library?

    Here?s the list of items that are checked in my References list:

    Visual Basic for Applications
    Microsoft Excel 11.0 Object Library
    Microsoft Office 11.0 Object Library
    atpvbaen.xls
    Microsoft Visual Basic for Applications Extensibility 5.3
    OLE Automation

    The item that triggers the error most of the time is function CHR that is being used in a macro in my Personal.xls workbook. I can?t remember the items in the References list that used to be there, but it seems to me that I always had VBAProject, which is the name for Personal.xls. I don?t see it anywhere now. I tried adding it manually, but got the message that it was a duplicate, but I can?t find a VBAProject anywhere in the list.

    Can anyone offer a solution?

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Sid
    Check for a reference marked as Missing and remove the tick.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Hi, Malcolm!
    Nothing that is checked is marked as missing. But I've discovered something else weird.

    If I check funcres, then close References, then go back into References, I see that VBAProject (read Personal.xls) is present and funcres is now unchecked. What's more, everything works OK until I restart Excel. Then everything is back to the way it was before I checked funcres.

    What library is the function CHR in? I can't remember which one, but another of the Excel functions also couldn't be found.

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I've always found this related to a missing reference. If it's not that, I don't know.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    CHR belongs to VBA.Strings. Select CHR in the code editor and hit F2. If you are not missing a reference then there may be a conflict in your registry. Download and run CCLeaner on your registry. As for the Strings module, I would fully qualify any method located in this module because it is the one that causes the most trouble because so many other languages use similiar method names such as Left, Right, ect... I do not understand why these methods are in a public standard module as opposed to a public class. I guess MS has their reasons.

    Change CHR to VBA.Strings.CHR
    Fully qualify everything until you no longer recieve compile errors.

    This will probably take care of the symptom though the problem may still remain.

Posting Permissions

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