Monday, September 16, 2019

excel vba - "Can't find Project or Library" for standard VBA functions



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?



-Adam


Answer



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.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...