VBA object libraries Office 2003 vs 2007


  1. Posts : 3
    Windows 7 Ultimate, 32 bit
       #1

    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


    TIA

    Ed
    Last edited by jagman653; 22 Dec 2013 at 14:30.
      My Computer


  2. Posts : 1,002
    XP Pro (x86) | 7 HP (x86) & (x64) | 7 Pro (x64)
       #2

    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 Computer


  3. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #3

    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 Computer


  4. Posts : 86
    Windows 7 Ultimate x64
       #4

    jagman653 said:
    However, to solve the current problem experimentally would mean installing Office 2003 on my Win7 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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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:49.
Find Us