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.
-Adam
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.
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.
Hmm. I'm getting a request for a VBAproject password. The plot thickens.
Time to find the origional developer I think.
I just wanted to add that I too had this problem but in a rather unique scenario. Some machines would have all the DLL's (including in this case Acrobat Distiller) and some would not. I still needed the machines without the Acrobat DLL to run macros that did not use it and so resorted to the VBA. namespace addition for these functions. This resolved the issue and worked in both scenarios.
I just wanted to point that I have meet the same problem, with none of the references marked as MISSING, I haven't found a resolution for it, but a temporary solution is: open the reference dialog in VBE, don't touch anything just click OK, and the VBA project back to normal.