PDA

View Full Version : Solved: Can't Find Project or Library



gmulhall
05-06-2008, 03:25 AM
Hi,

I have a macro which has suddenly stopped running when it hits the line

Select Case Mid(strInput, 1, 1)

with error message - cannot find project or library

The Mid function is highlighted.

I tried re-installing MS Office (2007) but the error still occurs. It all works fine on my work PC but not on my home PC.

Any help appreciated.

Thanks,

Geoff

Bob Phillips
05-06-2008, 03:51 AM
In the VBIDE, go to Tools>References. There you will see an item with MISSING: in its title. Uncheck that item and all should be well.

Report back with which library it was.

matthewspatrick
05-06-2008, 03:53 AM
Geoff,

Go to the VB Editor and check your references (Tools|References in the menu). Chances are, one or more will be listed as 'missing'. For these libraries, try removing the reference(s) and re-adding them.

matthewspatrick
05-06-2008, 03:54 AM
Sorry Bob, typing too slowly this morning :)

Bob Phillips
05-06-2008, 04:39 AM
Sorry Bob, typing too slowly this morning :)

What's 2 minutes between friends :smile:

gmulhall
05-06-2008, 05:10 AM
FIxed. Thanks so much guys !

Bob Phillips
05-06-2008, 05:15 AM
What library was it?

david000
05-06-2008, 10:07 AM
I tried re-installing MS Office (2007) but the error still occurs. It all works fine on my work PC but not on my home PC.


Does your work PC and your home PC have Excel 2007
Or
Was it Work 2003; home 2007???

I've run into this too.:(

Bob Phillips
05-06-2008, 10:20 AM
This is caused by someone creating code on one machine, and having a reference to a library (usually a totally superfluous library), and then porting it to another machine that doesn't have that library or that particular version.

As we said, delete the MISSING item usually fixes it.

gmulhall
05-06-2008, 03:54 PM
Hi,

There was nothing flagged as missing. I selected VBA Project and then deselected it - which I presume caused everything to reset and all worked fine thereafter.

I'm running the macro on 2007 at home and 2003 at work. It now runs fine on both.

Thanks again,

Geoff