views:

8601

answers:

6

So I'm having to run someone else's excel app on my PC, and I'm getting "Can't find Project or Library" on standard functions such as date, format, hex, mid, etc.

Some research indicates that if I prefix these functions with "VBA." as in "VBA.Date" then it'll work fine.

Webpages suggest it has to do with my project references on my system, whereas they must be ok on the developer's system. I'm going to be dealing with this for some time from others, and will be distributing these applications to many others, so I need to understand what's wrong with my excel setup that I need to fix, or what needs to be changed in the xls file so that it'll run on a variety of systems. I'd like to avoid making everyone use "VBA." as an explicit reference, but if there's no ideal solution I suppose that's what we'll have to do.

  • How do I make "VBA." implicit in my project properties/references/etc?
+3  A: 

I have seen errors on standard functions if there was a reference to a totally different library missing.

In the VBA editor launch the Compile command from the menu and then check the References dialog to see if there is anything missing and if so try to add these libraries.

In general it seems to be good practice to compile the complete VBA code and then saving the document before distribution.

0xA3
I agree.Missing references will be clearly marked MISSING. In your case, I suspect it is a later version of the Excel library, which can be got around with late binding, or selecting the earlier library.I do not believe that compiling the code will help with missing references.
Remou
Hmm. I'm getting a request for a VBAproject password. The plot thickens.
Adam Davis
Time to find the origional developer I think.
Toby Allen
+2  A: 

I have experienced this exact problem and found, on the users machine, one of the libraries I depended on was marked as "MISSING" in the references dialog. In that case it was some office font library that was available in my version of Office 2007, but not on the client desktop.

The error you get is a complete red herring (as pointed out by divo).

Fortunately I wasn't using anything from the library, so I was able to remove it from the XLA references entirely. I guess, an extension of divo' suggested best practice would be for testing to check the XLA on all the target Office versions (not a bad idea in any case).

Cannonade
A: 

In my case, it was that the function was AMBIGUOUS as it was defined in the VBA library (present in my references), and also in the Microsoft Office Object Library (also present). I removed the Microsoft Office Object Library, and voila! No need to use the VBA. prefix.

A: 

I am receiving this error but I am unable to check the references due it being grayed out. I am also receiving this error one individual's computer no matter what type of excel file is opened up.

Do you have any other recommendations for fixing this error. Luckily there is spare work space so she can still continue to work.

Thanks.

jane
A: 

jane, you gotta click the stop button and the references menu item won't be grayed out any more

it doesn't let you edit references while the project is running/paused

fumf