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 Windows 7 using Office 2007. The user wants to run it under Windows 7 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 Windows 7 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 Windows 7, albeit with Office 2007.

VBA object libraries Office 2003 vs 2007-excelreferences.jpg


TIA

Ed




My System SpecsSystem Spec
.

23 Dec 2013   #2

XP/7x32-x64/8x64
 
 

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 Windows 7 machine which is not attractive to me.
Ed,

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.

See: http://www.jpsoftwaretech.com/excel-...y-late-binding
My System SpecsSystem Spec
Reply

 VBA object libraries Office 2003 vs 2007




Thread Tools



Similar help and support threads for2: VBA object libraries Office 2003 vs 2007
Thread Forum
ms office 2003 and 2007 Microsoft Office
File Validation from Office 2010 to Office 2003 and Office 2007 News
Can Office 2003 and Office 2007 co-exist on a Win7 system? Microsoft Office
Office 2007 vs Office 2003 for new Win 7 64-bit laptop 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 04:58 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33