+ Reply to Thread
Results 1 to 11 of 11

Error in function Compile error: Can't find project or library

  1. #1
    Registered User
    Join Date
    12-11-2013
    Location
    Chihuahua, Mexico
    MS-Off Ver
    Excel 2007
    Posts
    4

    Error in function Compile error: Can't find project or library

    Hello Guys, I'm trying to create a function using the following formula,

    =concatenate(Hex2Dec(Left(ESN, (Len(ESN) - 6))), (Hex2Dec(Right(ESN, (Len(ESN) - 8)))))

    when I try to use it appear Compile error: Can't find project or library and the cursor is selecting left function. I was reviewing my libraries but not sure why is happend this one. Did you see this before? any ideas?

    Thank you

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Error in function Compile error: Can't find project or library

    The Hex2Dec function is expecting a numeric value. The Left function returns a Text string. Perhaps if you convert that string to a number the function will work properly?

    e.g.

    LEFT(ESN,LEN(ESN)-6)+0

    Same applies to the RIGHT function (and MID, just in case).

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Error in function Compile error: Can't find project or library

    Hmm, after testing, I may have been mistaken...

    Is there a problem with the ESN reference? What is that a reference to? A named range (cell) or function? Is it at least 6 characters in length?

  4. #4
    Registered User
    Join Date
    12-11-2013
    Location
    Chihuahua, Mexico
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Error in function Compile error: Can't find project or library

    Thank you Paul I just convert to number but doesn't work I got the same error.

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Error in function Compile error: Can't find project or library

    Can you upload a copy of your workbook with some sample data? (Remove any private data first.)

  6. #6
    Registered User
    Join Date
    12-11-2013
    Location
    Chihuahua, Mexico
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Error in function Compile error: Can't find project or library

    Here you go

    Thank you
    Attached Files Attached Files

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Error in function Compile error: Can't find project or library

    There are no formulas in that workbook.

    And your post suggests a VBA problem, but there's no code either. CONCATENATE and HEX2DEC are Excel functions, not VBA.
    Last edited by shg; 12-11-2013 at 07:32 PM.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Error in function Compile error: Can't find project or library

    In your sample workbook the hex value is in cell A2. Putting this formula in A3 I get results (no error):

    =CONCATENATE(HEX2DEC(LEFT(A2,(LEN(A2)-6))),HEX2DEC(RIGHT(A2,(LEN(A2)-8))))

    Returned value in A3:

    26843545652993867

    If ESN is a named range pointing to cell A2 I get the same results.

  9. #9
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Error in function Compile error: Can't find project or library

    As SHG suggests, you didn't provide any code. If you're trying to create a User-Defined Function in VBA, and ESN is considered the pointer to the cell you want to convert, you could use something like the following code. This code would go into a standard module, and then on the worksheet you could use

    =conv(A2)

    to convert the hex value in A2 to the concatenated decimal value.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-11-2013
    Location
    Chihuahua, Mexico
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Error in function Compile error: Can't find project or library

    Thank you is working now

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Error in function Compile error: Can't find project or library

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Compile Error in Hidden Module and Compile Error: Can't find project or library
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2013, 07:03 PM
  2. [SOLVED] Compile Error: Can't find project or library (1 computer has the error, another does not?)
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 06-28-2012, 12:09 PM
  3. Compile Error: Can't find project or Library
    By ashmakda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2011, 06:20 PM
  4. Compile error: Can't find project or library
    By viuf81 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2010, 03:12 AM
  5. Replies: 2
    Last Post: 06-10-2006, 04:15 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1