Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: VBA object libraries Office 2003 vs 2007

22 Dec 2013   #1

Windows 7 Ultimate, 32 bit
VBA object libraries Office 2003 vs 2007

I developed an Excel addin in Win7 using Office 2007. The user wants to run it under Win7 but using Office 2003. It's getting compile errors "Can't find project or libraries." I'm familiar with the issue because it came up a couple years ago when the same user was using the code with Office 2003 on an XP machine. I was able to solve the problem because I happened to have XP and Office 2003 on another machine. It was a matter of getting the Office 2007 (Office 12) object files into the right places. However, to solve the current problem experimentally would mean installing Office 2003 on my Win7 machine which is not attractive to me.

So, the question is this: What object libraries do I have to put onto his machine, and where. The attachment shows a screenshot he's getting now. My guess is I have to make it use Office 12 stuff instead of Office 11 since that's what works on my Win7, albeit with Office 2007.

VBA object libraries Office 2003 vs 2007-excelreferences.jpg



My System SpecsSystem Spec
23 Dec 2013   #2

XP Pro (x86) | 7 HP (x86) & (x64) | 7 Pro (x64)

I assume you are talking about VBA

I have written a lot of Excel addins for Excel 2003 over the years
I recently purchased Office 2010 because after Excel 2010 I believe the code language is not VBA although older VBA code will run.
If 2010 last me another 5 to 8 years it will get me past my use-by date.
I have to rewrite some of my 80 addins to be compatible with Excel 2003 and Excel 2010 for some of my clients.
You are possibly up against several problems
  1. 2007 References not available in 2003, ie, some 2007 objects/methods/functions are simply not available in 2003 and visa versa.
    References can be enabled/disabled with VBA
  2. in 2003 Excel, some early bound classes might Err in a 2007 environment, depending on References.
    Late bound Classes can be very helpful where the addin is to be used by different versions of Excel
    Or simply disable Excel v12 Reference , and write your addin from that point.
  3. Are you using forms?
You might have to use late-bound classes to work around MS changes to methods/functions.
2003 numeric data-types are maxed at Long Integer for 65,xxx rows where as I think Excel-2007 has 1million rows, and there is a new numeric Extra Long integer data-type for Excel 2007.

Not being familiar with 2007, I am not absolutely clear on differences between 2003 and 2007 VBA
But I am willing to help you as much as I can.

Hope this is clear enough, way past my bed time.
My System SpecsSystem Spec
23 Dec 2013   #3

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1

Can you post the xla addin here? Then I can have a look.

Use "Late Binding" if you will bind to "current excel library" for example.
What happens if you simply copy/paste the vba code from office 2007 to office 2003 ... what compile or run errors?
My System SpecsSystem Spec

24 Dec 2013   #4
Microsoft MVP

Windows 7 Ultimate x64

Quote   Quote: Originally Posted by jagman653 View Post
However, to solve the current problem experimentally would mean installing Office 2003 on my Win7 machine which is not attractive to me.

I use XP Mode in Windows 7 to run Office 2003. That way it is isolated from you Windows 7 and Office 2007.

I agree that Late Binding would solve your reference issues because the the library reference is set at runtime. .

This assumes your VBA code is backwardly compatible with 2003. For me that mean you should still install 2003 for proper testing.

My System SpecsSystem Spec

 VBA object libraries Office 2003 vs 2007

Thread Tools

Similar help and support threads
Thread Forum
ms office 2003 and 2007
I think that ms office 2003 is better than to use 2007. It is very simple for easy to use. Company also provided an new version of 2007. There are something difference to 2003 and 2007. In 2003 you can find different time tool so go on sub menu. and the 2007 more type of is outside mean all...
Microsoft Office
File Validation from Office 2010 to Office 2003 and Office 2007
File Validation from Office 2010 to Office 2003 and Office 2007 - Softpedia
Office 2007, but need 2003 Exel?
Hi, I have Office 2007 installed on Win7, but I need to use and do an online course for 2003 Exel. Is it possible to just install the 2003 Exel and leave 2007? Any conflicts if I do this? OR Do I have to uninstall Office 2007 and reinstall the complete Office 2003? Thanks in advance. :D
Microsoft Office
Can Office 2003 and Office 2007 co-exist on a Win7 system?
Can I (in addition) to an already installed Office 2003 install the Office 2007 version as well? Or do they interfere each other? Peter
Microsoft Office
Office 2007 vs Office 2003 for new Win 7 64-bit laptop
I have a new thinkpad laptop that came installed with Office Professional 2007 trial. I have an existing license for Office 2003 Small Business which I was running on my prior laptop. While I like the enhancements made to 2007 (vs 2003), I definitely don't need all the modules that come with...
Microsoft Office

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 17:57.
Twitter Facebook Google+