+ Reply to Thread
Results 1 to 16 of 16

Compile Error: Object library invalid or contains references

  1. #1
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Post Compile Error: Object library invalid or contains references

    This is my first Querry to Excel VBA forum, so kindly excuse me if it is not is proper order.
    I have developed a excel VBA program for inventory management system & that sheet was working fine for about a year or so.
    But from last few days, the sheet is not working & following message is appearing:

    "Compile Error: Object library invalid or contains references to object definitions that could not be found."

    I am using following references:

    1) Visual Basic for Applications
    2) Microsoft Excel 15.0 Object Library
    3) OLE Automation
    4) Microsoft Office 10.0 Object Library
    5) Microsoft Forms 2.0 Object Library

    My Excel version is 2013, 64 bit Microsoft Windows 10 Operating System.

    The same file is getting opened in my collegue PC with same configuration as mentioned above.

    Kindly help.

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Compile Error: Object library invalid or contains references

    Quote Originally Posted by mayurpote View Post
    The same file is getting opened in my collegue PC with same configuration as mentioned above.
    I take it that it opens fine on your colleagues computer?

  3. #3
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    Yes it works fine in other PC

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Compile Error: Object library invalid or contains references

    If you have Office 2013, the Office reference library should also be version 15.0, not 10.0
    Rory

  5. #5
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    Sorry that was a type error, the reference file is:
    4) Microsoft Office 15.0 Object Library only.
    Also sharing some additional inputs:
    The Original excel sheet was developed on Excel 2007 but was working fine on Excel 2013 or is working fine on Excel 2013 on other PC except mine.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Compile Error: Object library invalid or contains references

    Do you have activex objects (eg MSForms controls) added to worksheets in that workbook?

  7. #7
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    Yes , I have some userforms & buttons on the Excel for opening the userforms for various application.

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Compile Error: Object library invalid or contains references

    Userforms shouldn't be a problem but can you replace the buttons on the sheets with Form buttons rather than ActiveX?

  9. #9
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    I checked the codes & found that the name of the Textbox in Program & actual neam in the Text box Property are not same. But I dont know how it got changed as same is getting opened fine in other PC.
    As I cannot change the Textbox Property, I changed the Textbox names in VB Program. After which Compile error has gone but now new error is coming as follow:
    " Run Time Error '32809':
    Application-defined or object-defined error"
    Can Anyone help find the reasons for above issues & solution for it.

  10. #10
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    I am finding that each time when I save the same file, the Textbox names in the Property window are getting changed randomly.

  11. #11
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    Just to clarify: These are ActivX Control Textbox on the Excel sheets & not on the Userform.

  12. #12
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Compile Error: Object library invalid or contains references

    It sounds like you are running into the problem that occurs periodically when an Office update is released and one machine has it while another doesn't. It can sometimes be fixed by deleting .exd files from both PCs but the best advice I can give you is to not use activex controls on worksheets if you can possibly avoid it.

  13. #13
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    I am also not able to delete the Textbox. whnever I am trying to do so the Excel stops working & reopens.

  14. #14
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    I have also tried by deleting the .exd file by following path in Run:
    %APPDATA%\Microsoft\Forms
    But still the problem could not be rectified.

  15. #15
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Compile Error: Object library invalid or contains references

    As I said, it doesn't always work - but there could be .exd files in other locations too, so you need to make sure you delete all of them.

    Try disabling macros, opening the workbook and then deleting the textboxes.

  16. #16
    Registered User
    Join Date
    11-23-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    10

    Re: Compile Error: Object library invalid or contains references

    Is there any other solution, if I want to use the Active X Textbox.
    Actually I am using the Textbox for searching the required Material in a protected sheet.
    Whenever someone enters the text in the Textbox, the sheet unlocks & shows the available material & automatically gets protected again.
    I have used this because I was not able to use the filter functionality on a protected sheet.
    Is there any other way to use the Filter functionality on a protected sheet?

+ 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] Object library invalid or contains references to object definitions that could not be foun
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-01-2015, 07:36 AM
  2. Compile error : object library invalid or contains references
    By SIMBAtheCAT in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2014, 10:25 PM
  3. Replies: 12
    Last Post: 06-20-2012, 01:53 PM
  4. “Object library invalid” error
    By PY_ in forum Excel General
    Replies: 6
    Last Post: 04-16-2012, 08:14 PM
  5. Compile Error - Can't Find Object or Library
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-06-2009, 07:23 AM
  6. object library invalid or contains references Error in addin Excel 2003
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-18-2009, 11:34 AM
  7. Compile Error: Invalid use of object
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2006, 03:05 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