Consulting

Results 1 to 5 of 5

Thread: Solved: Left -Right -Mid functions not available

  1. #1
    VBAX Regular
    Joined
    Jan 2006
    Posts
    30
    Location

    Solved: Left -Right -Mid functions not available

    Hi folks,

    strange thing...can't explain why it happens. In my code for an Excel application I use the built-in functions Left- and Right, like in: [VBA]Msgbox Right("This is a test", 5)[/VBA] Which normaly reults in displaying a message box with "test". I so happens in all (new) files, except for the one I have been working on for quite some time. The machine I use in the office uses W2K and Office XP, at home I use WXP and Office 2000. This afternoon, in the office, the code ran wiithout a problem, but at home I get a message
    Compile Error:
    Can't find Project or Library
    I have not a clue why this happens. I do not load any special add-ins, I tried it out on two other machines (W2K/Office 2000) with same result .

    Why doesn't it run in this file, and without problem in other (new) files ? If any of you have a clue, plse help me out.

    Regards,

    Thymen

  2. #2
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    That means you have Option Explicit declared in the error producing machine but an undeclared variable being present...

    Most likely anyway...

    well, if it works one place, but not the other...

    You need to check Tools>References in the VB window and see if any are prefixed with MISSING:

    Uncheck that one and you should be okay..
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  3. #3
    VBAX Regular
    Joined
    Jan 2006
    Posts
    30
    Location
    XLGibbs,

    done! Unchecked some missing web components (do not need them anyway) and it runs now!

    Thanks a million!

    Thymen

  4. #4
    MS Excel MVP VBAX Tutor
    Joined
    Mar 2005
    Posts
    246
    Location
    As a matter of interest, I have often gotten an error when using functions from the VBA Strings library (left, right, mid, etc.), when the missing reference is completely unrelated. That was the case here again, I see. It's as if the Strings library is like the canary in a coal mine that tells you when there is a reference-related compile error elsewhere in the code.
    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______

  5. #5
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Thanks for that John. Another example of using older versions to develop to avoid potential missing references, as in the recent post at Mr.Excel regarding the mscal.ocx and related calendar references...
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •