Cannot find project or library for standard VBA functions

Thus, I need to run the application of another application on my PC, and I get "I can not find the project or library" on standard functions such as date, format, hexadecimal, average, etc.

Some studies show that if I prefix these functions using "VBA". as in "VBA.Date", then it will work fine.

Web pages suggest that this is due to my design recommendations on my system, whereas they should be fine on the developer's system. I will deal with this for some time from others and will distribute these applications to many others, so I need to understand what is wrong with my excel setting, which I need to fix, or what needs to be changed in xls so that it works in different systems. I would like everyone not to use "VBA". as an explicit reference, but if there is no perfect solution, I suppose we will need to do.

  • How do I create a "VBA". implicitly in my properties / links / etc?

-Adam

+73
reference vba excel-vba namespaces excel
Feb 03 '09 at 14:05
source share
4 answers

I saw errors in standard functions if there was a link to a completely different library.

In the VBA editor, run the Compile command from the menu, and then open the Links dialog box to see if there is something, and if so, try adding these libraries.

In general, it seems good practice to compile the full VBA code and then save the document before distribution.

+62
Feb 03 '09 at 14:24
source share

I had the same problem. This worked for me:

  • In VB, go to Tools & raquo; References
  • Uncheck the Crystal Analysis Common Controls 1.0 library. Or any library.
  • Just leave these 5 links:
    • Visual Basic for Applications (this is the library that defines the VBA language.)
    • Microsoft Excel Object Library (defines all Excel elements.)
    • OLE Automation (Types for linking and embedding documents and for automating other applications and the plumbing of the COM system that Excel uses to communicate with the outside world are listed here.)
    • Microsoft Office (This defines things common to all Office programs, such as command bars and command line elements).
    • Microsoft Forms 2.0 This is required if you are using a custom form. This library defines elements such as the user form and controls that you can place on the form.
  • Then save.
+29
Jul 08 2018-11-11T00:
source share

I ran into this exact problem and found that on the user's computer one of the libraries I was dependent on was marked as "MISSING" in the links dialog. In this case, it was some office font library, available in my version of Office 2007, but not on the client’s desktop.

The error you get is a complete red herring (as indicated in the divo).

Fortunately, I did not use anything in the library, so I managed to completely remove it from the XLA links. I assume that an extension of the proposed best practice divo would be for testing to test XLA on all target versions of Office (not a big idea anyway).

+15
Mar 04 '09 at 22:44
source share

In my case, this function was AMBIGUOUS, because it was defined in the VBA library (present in my links), as well as in the Microsoft Office object library (also present). I deleted the Microsoft Office object library and voila! No need to use VBA. Prefix.

+9
Jul 11 '09 at 14:14
source share



All Articles