Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2018, 04:51 PM
jag_man653 jag_man653 is offline Adding reference to Office 12 Object Library to Windows 7 32bit Adding reference to Office 12 Object Library to Office 2007
Novice
Adding reference to Office 12 Object Library to
 
Join Date: Mar 2013
Posts: 10
jag_man653 is on a distinguished road
Default Adding reference to Office 12 Object Library to

Awhile back I switch to Windows 10 and Excel 2016 from Windows 7 Office 12. No major problems until a new user is still running Win7 & Office 2007.

I've read that I should work in Excel 2016 and simply reference Office 12 Object library in the References - VBAproject dialog. So, I've found the Office 12 folder on my Windows 7 machine and put a copy into C:\Program Files (x86)\Microsoft Office on the Win 10 machine, exactly where the Office 16 folder is.

Now, here's the problem. The References - VBAproject Browse dialog is looking for a specific dll, not a folder with a bunch of them. If I know exactly which one (or ones) I needed, that would be OK. But I don't know that. My VBA probably uses a lot of them and I don't know exactly which one is causing my app to crash when run on a Win 7 Office 12 machine.

What am I missing?



Ed
Reply With Quote
  #2  
Old 01-24-2018, 10:10 PM
macropod's Avatar
macropod macropod is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Stop!

Simply copying the Office 12 folder to your Office 2016 PC won't work. Evidently, you're doing some form of automation and your code uses early binding. To continue using that, you should compile the project on a PC using the earliest version of Office you're required to support; otherwise switch to late binding.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-25-2018, 09:00 AM
jag_man653 jag_man653 is offline Adding reference to Office 12 Object Library to Windows 7 32bit Adding reference to Office 12 Object Library to Office 2007
Novice
Adding reference to Office 12 Object Library to
 
Join Date: Mar 2013
Posts: 10
jag_man653 is on a distinguished road
Default

Thanks, Paul. I'm trying to do what your saying. After putting the Office 2012 folder on my current development PC at C:\Program Files (x86)\Microsoft Office (where Office 16 is) I am trying to add it to it with the References - VBAproject dialog. I.E., Early binding with the earlier version of the object libraries. However, I can't figure out how to do it because the Browser button in that dialog won't allow selection of a folder. It's filter allows only .dll and the like.
Reply With Quote
  #4  
Old 01-25-2018, 10:16 AM
jag_man653 jag_man653 is offline Adding reference to Office 12 Object Library to Windows 7 32bit Adding reference to Office 12 Object Library to Office 2007
Novice
Adding reference to Office 12 Object Library to
 
Join Date: Mar 2013
Posts: 10
jag_man653 is on a distinguished road
Angry

Quote:
Originally Posted by macropod View Post
Stop!

... you should compile the project on a PC using the earliest version of Office you're required to support.
Or, do you mean switch back to my old Win 7 machine with Office 12? that would be a bummer What do developers who don't have an earlier platform do?

I'm not dismissing the idea, but still have the hope of being able to do it on my new machine.

Ed
Reply With Quote
  #5  
Old 01-25-2018, 01:02 PM
macropod's Avatar
macropod macropod is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Simply copying various Office 2007 files back to the PC with Office 2016 is not the same as having Office 2007 installed. You need to have Office 2007 installed if that's what you're developing for with early binding.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 02-20-2018, 05:29 AM
Debaser's Avatar
Debaser Debaser is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

You should not have to (or be able to) update the Office or Excel library references - they should adjust with the version of Office automatically.
Reply With Quote
  #7  
Old 02-20-2018, 01:31 PM
macropod's Avatar
macropod macropod is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That has only ever been the case for references to libraries earlier than the one in use; it has never applied to references to libraries later than the one in use. Thus, a Word VBA project using references to the Excel 14.0 library will automatically work on systems with the Excel 15.0 library but will not do so on systems with only the Excel 12.0 library.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 02-20-2018, 02:23 PM
Debaser's Avatar
Debaser Debaser is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

I'm afraid that's not correct. If it were, you would have to late bind Excel code in Excel and remove the Excel reference, which is not possible. It is true that if you were writing code in Word, you'd have to update a reference to Excel, but code in Excel using references to Excel and Office (which are default references) does not require changing references, regardless of whether you are in an earlier or later version.
Reply With Quote
  #9  
Old 02-20-2018, 02:37 PM
macropod's Avatar
macropod macropod is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

While it is true that no library references need be added for code that's not doing any automation, they are needed for early binding with automation. Automation code compiled for newer libraries cannot be guaranteed to work with earlier ones. As advised by Microsoft (https://support.microsoft.com/en-us/...n-automation):
Quote:
If you need to automate an Office application, it is recommended that you early bind to the earliest version of the product that you expect could be installed on your client's system. For example, if you need to be able to automate Excel 95, Excel 97, Excel 2000, and Excel 2002, you should use the type library for Excel 95 (XL5en32.olb) to maintain compatibility with all three versions.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 02-20-2018, 02:43 PM
Debaser's Avatar
Debaser Debaser is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

Yes, but that is not the case here, which is why I said there is no need to update any references.
Reply With Quote
  #11  
Old 02-20-2018, 02:55 PM
macropod's Avatar
macropod macropod is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The OP's reply in post #3 to what I wrote in post #2 suggests otherwise.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 02-20-2018, 03:31 PM
Debaser's Avatar
Debaser Debaser is offline Adding reference to Office 12 Object Library to Windows 7 64bit Adding reference to Office 12 Object Library to Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

You may be right. Everything I've seen here suggests to me that the OP thinks he has a problem based on what he's read. Nowhere have I seen any mention of a specific actual problem. Either way, the Excel/Office references should not be an issue.
Reply With Quote
Reply

Tags
adding object library, vba excel



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding reference to Office 12 Object Library to Microsoft Excel 12.0 Object Library reference upload chamdan Project 2 04-21-2014 06:30 AM
Adding reference to Office 12 Object Library to Let Office Object Library 14.0 work in Office 2007 tinfanide Word VBA 14 12-23-2011 02:43 PM
Adding reference to Office 12 Object Library to Excel VBA: How to add a reference to Microsoft Word Object Library? tinfanide Excel Programming 7 12-12-2011 05:21 AM
Problem: object library invalid or contains references to object definitions aligahk06 Office 0 08-19-2010 12:29 PM
Access Object library 10 Gyto Office 0 10-09-2008 09:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft