+ Reply to Thread
Results 1 to 20 of 20

Comile Error: Can't find project or library

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Comile Error: Can't find project or library

    Please can someone help me with this.

    One of our employees has wrote a VB project in excel 2010 which works on some machines and not others, it comes up with the below error message.

    I have checked VB and there are no missing references.

    Compile Error: Can't find project or library


    Private Sub UserForm_Initialize()

    'Empty ClientCodeComboBox
    Me.ClientCodeComboBox.Clear

    'Fill ClientCodeComboBox
    Me.ClientCodeComboBox.List = Worksheets("Index").Range("A2:A" & Worksheets("Index").UsedRange.Rows.Count).Value

    'Prepare CompanyCodeBox.Caption
    Me.ClientNameLabel.Caption = ""

    'Uncheck CompanyCodeCheckBox
    Me.CompanyCodeCheckBox.Value = False

    'Clear YearEndDateBox
    Me.YearEndDateBox.Value = Date
    Me.YearEndDateBox.MaxDate = Date

    'Clear ScanDateBox
    Me.ScanDateBox.Value = Date
    Me.ScanDateBox.MaxDate = Date

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    Did you look for missing reference on machine where error occurs?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    Yes looked under references but nothing missing. I'm assuming you just mean VB references.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    Yes - project references in VB Editor. To confirm - you are checking on the computer where code errors? On computer where it runs, references will look ok. What references are set in this project?

    What kind of control are YearEndDateBox and ScanDateBox? Also, are all computers having same version of Office?

  5. #5
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    References set in the project are:

    Visual Basic for Applications
    Microsoft Excel 14.0 Object Library
    OLE Automation
    Microsoft Office 14.0 Object Library
    Microsoft Forms 2.0 Object Library
    Microsoft Windows Common Controls-2 6.0 (SP4)

    "YearEndDateBox" and "ScanDateBox" are DateTimePicker controls.

    All machines are using office 2010

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    To confirm - you are checking on the computer where code errors?

    Most likely problem is Microsoft Windows Common Controls-2 6.0 (SP4) reference.

    Please try to change code to:
    Please Login or Register  to view this content.
    and test if there is still error.

  7. #7
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    Yes im checking my computer which it errors on.

    I installed the Microsoft Windows Common Controls-2 6.0 (SP4) reference manually yesterday as it said it was missing.

    Now when I check references it does not say missing and points to the required file.

  8. #8
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    Does your computer still error? How did you install the reference?

  9. #9
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    Yes the computer still errors, I downloaded it from Microsoft website and pointed it to the location required. C:\Windows\SysWOW64\mscomct2.ocx

  10. #10
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    You must register this file using regsvr - I do not think it is sufficient to simply copy it.

  11. #11
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    I've download the cab file from Microsoft and extracted the ocx file to C:\Windows\SysWOW64.

    I then ran the following command from the command prompt logged in as Administrator.

    regsvr32 C:\Windows\SysWOW64\mscomct2.ocx and received the message it had been registered successfully, but it still didn't work.

    I've ran revDllView to see if the file is loaded but it isn't.

    Any other suggestions?

    Thanks

  12. #12
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    You have 32bit Office? (this controls will not work for 64bit Office)

    Do you see controls on userform in design view?

  13. #13
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    Yes it is Office 32Bit

    Not exactly sure what you mean by "Do you see controls on userform in design view?"

    Please can you help me further.

  14. #14
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    Capture.PNG Please see attached image.

  15. #15
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    It appears that the DTPicker controls have been removed from the form so the code will not work. Do you have old copy of this file?

  16. #16
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    We have the exact same spread sheet working on another machine. Some machines it works on and some it does not.

    I am trying to get to the bottom of why?

  17. #17
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    If you do not have same Common Controls library registered I think your controls will be removed when project is loaded and therefore code will not work. If you may not ensure common platform for all computers I think it will be better to avoid use of common controls.

  18. #18
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    What would you recommend instead of using common controls for the user form.

  19. #19
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Comile Error: Can't find project or library

    Textbox or Combobox controls. These are standard.

  20. #20
    Registered User
    Join Date
    03-04-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Comile Error: Can't find project or library

    Thanks I will let you know how I get on.

+ 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. Can't find Project or Library Error
    By ElsiePOA in forum Excel General
    Replies: 2
    Last Post: 12-13-2010, 02:33 AM
  2. error can't find project or library
    By cedtech23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2006, 01:48 PM
  3. [SOLVED] Can' find project or library Error
    By Nicholas B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2006, 11:50 AM
  4. Can't find project or library Error?
    By RS in forum Excel General
    Replies: 0
    Last Post: 02-15-2006, 12:15 AM
  5. Error:Can't find project or library
    By Casey in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-13-2005, 05:05 AM

Tags for this Thread

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