You can fix it by placing "VBA." qualifier in front of every occurrence of those functions or by recreating the project (create new project and add all existing objects).
Sorry but I am not aware of any better way...
Last edited by RhinoBull; Jan 5th, 2011 at 08:47 AM.
Thanks for feedback.
Good idea trying VBA Qualifier first. Something I would of never thought of.
Will leave thread open for couple days or until resolved.
Have a nice evening.
David
======== Followup ==============
Used VBA Qualifier and program works like a charm.
Hats off to you.
I know SAVAII will appreciate the program.
David
Last edited by dw85745; Jan 4th, 2011 at 11:56 PM.
Reason: FollowUp
A better way is to check for missing references, as that only takes a few seconds, and based on many hundreds of previous threads it is usually the cause of the problem.
The time to fix a missing reference is usually low (sometimes a matter of seconds in total), and it is always a permanent fix - whereas dealing with the symptoms as suggested above needs to be done to any code you add/alter in future.
There are more details of checking missing references (along with other options for solving the various causes of problem) in the "Fixing common VB Errors" link in my signature.
A better way is to check for missing references, as that only takes a few seconds, and based on many hundreds of previous threads it is usually the cause of the problem...
"Usually" is the key here but it's not really always - I cannot recall at least one case when references to VBA were missing. They were always in place so for me it was a matter of applying technique I've mentioned earlier.
I have never seen the VBA reference itself be missing, nor heard of that happening - but when there is a missing reference it is usually items in the VBA library that the error shows for (as I've proved to you in the past with simple test projects).
I have given a brief explanation of a potential cause for it in the "side note" in the article, but of course we can't be sure because we don't have the code etc for the compiler.
As it only takes literally a few seconds to check the references screen, does it really hurt to try it first?
Last edited by si_the_geek; Jan 5th, 2011 at 09:30 AM.
Reason: fixed typo in tags
Thought I give a little feedback as what was occurring going from VB6 to VB5.
1) Loaded project and bypassed Retained and DebugKey not found prompts. (this is normal)
2) Tried to run program from IDE and failed on a number of VBA methods (Chr, Trim, etc.0
3) Checked references and found two missing.
4) Checked my system for these references and not installed.
5) Checked web and found references most likely belonged to an enterprise development not professional Based on references figured they could be deleted.
6) Deleted missing references from VBP file.
7) Checked if program used ADO. It didn't so deleted reference to ADO from VBP.
8) Tried to run program from IDE and still failed on VBA methods.
9) Created a new standard blank VB5 project and compared references.
10) All references between both projects appeared to be same.
11) Another run from IDE attempted. Failed again on VBA methods.
12) Post to forum where Rhinobull solution worked.
Can't explain why this particular program would need the VBA object reference but it did.
It seems that missing references were at least part of the problem... and either there is something else causing problems too, or your attempts to fix the references were not successful.
It isn't clear from what you posted, but I get the impression there is no longer anything marked as missing - in which case that part is fine, and there is another cause.
Could you upload the project (including all code files etc), and preferably also the .vbp for a new blank project?