Compile Error: Can's Find a Project or Library - Compatibility

Bovey44

New Member
Joined
Jul 4, 2020
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
I've developed several macros that include references to files/workbooks (open/close, read & write). I've provided the files and associated macros to another PC where the Microsoft Object Library is 14.0 while mine is 16.0.

I receive the error indicated in the name of this post -is the error "Compile Error: Can't Find Project or Library" caused by the difference in object library versions? And, if so - what can I do to alleviate the problem; thus, to get the macros to run on the other PC?

Thank you.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
38,113
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
The Office and Excel object libraries should not cause that error. What other references do you have set?
 

Bovey44

New Member
Joined
Jul 4, 2020
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
There are four references: Visual Basic For Applications; Microsoft EXCEL 16.0 Object Library; OLE Automation; Microsoft Office 16.0 Object Library - those are the ones on my PC where I developed the code. The other PC where I'm trying to run the code has the same except it's 14.0 for the EXCEL & Office Library.
 

Bovey44

New Member
Joined
Jul 4, 2020
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
I'm getting the compile error: can't find a project or library on open statements like this: Workbooks.Open Filename:="C:\A_CAMS_SO\LOG_SPOE=KRISTEN.xlsm"
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
38,113
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Those should not cause that problem, although it is the second post I have seen recently with this issue and those same 4 references. Any chance you can put the workbook somewhere for me to look at (eg Onedrive / Dropbox)? It doesn't need to have any data in it.
 

Bovey44

New Member
Joined
Jul 4, 2020
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
Thank you, Rory for following up on my request. I'm not up-to-date on using Dropbox or sharing via Onedrive - any other suggestions? An email with the file as an attachment would have been convenient.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,488
Messages
5,770,380
Members
425,613
Latest member
martinijr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top