Consulting

Results 1 to 4 of 4

Thread: Solved: Can't use Right function???

  1. #1
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location

    Solved: Can't use Right function???

    My code use to work, but now I get a compile error with the Right function. For some reason is says "Cannot Find project or Library".

    Here's my line of code:


    [VBA]SentType = Right(ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text, 1)[/VBA]

    But this even happens even if I try this:

    [VBA]
    Debug.Print Right("Hey" , 1)
    [/VBA]

    What gives?




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  2. #2
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Nevermind. I just figured it out.

    I have another module with a procedure that uses early binding to Outlook...and the reference was turned on as "Missing Outlook 11.0 Object Library". When I turned this off, the Right function works.

    That was strange, huh?




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  3. #3
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Joseph,
    I came across this a wee while ago, but with Format. The lesson must be to check references of downloaded workbooks!
    Regards
    Malcolm
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    I would say so.

    Maybe I should just start using late binding....or at least convert it at the end of writing the procedure.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

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