VBA: Compile error. Can’t find project or library

Another day, another problem with my spreadsheet application.  Just tried to run it on another machine in my office and this is the error I got, followed by the VBE highlighting the use of ‘Chr’ in my code.

A little bit perplexed I checked out the References (Tools>References) in the VBE and found that one was marked as ‘missing’, so unchecked this and saved, then closed the sheet.  Once I’d re-opened it things seemed to work absolutely fine.

If you do get this problem, have a look at your references box to check for missing items.

For most things to work you will need at least the following four references ticked also:-

Visual Basic For Applications
Microsoft Excel xx.x Object Library
Microsoft Office xx.x Object Library
OLE Automation

My assumption will also be that there is a similar fix if you are using Access or Word (or any other software which allows programming in VB/VBA), so I would check for missing references if you have any of the same problems in those also.

One comment

  • Aretha Beach
    June 19, 2010 - 6:45 am | Permalink

    Another new article with good points, I’ve been a lurker right here for some time but desire to be far more included in the future.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *