Consulting

Results 1 to 13 of 13

Thread: Solved: Compatibility of Macros coded in 2007

  1. #1
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    357
    Location

    Question Solved: Compatibility of Macros coded in 2007

    I want to if I code a macro in Office 2007 for excel or outlook.
    Will that macro be compatible in office 2003......?????

    Because in my office I have Office 2003 but for my laptop I want to upgrade to Office 2007.

    Hence I want to be sure that macros coded in Office 2007 will work in office 2003



    Thanks
    Sudhir

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    There are a few differences, but in the main, anything you code in 2007 VBA will work in 2003 VBA, it has changed very little.

    Obviously the object model has changed, colour schemes, charting, CF has changed dramatically n 2007, so that may well not work in 2003.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    or you could incorperate late binding to auto add/remove libraries(refrences) so that it' will be compatible

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    How will a library reference help if you use some part of the object model that doesn't exist in excel 2003?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    your right, I am assuming that just by chance kbsubhir won't use a lib ref that doesn't exist in 03

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The Excel 2007 object model is within the Excel 2007 type library and you don't get an option NOT to use that in Excel 2007.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    I didn't know that one but i know in access if you start your project on 03 access and then work on it on 07 access and you try to do something not avilable in 03 access you get a warning, asking if you realy want to use that object that it isn't compatable w/ lower vers.

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    In 2007, when you save the workbook as a 2003 type book, if you use any features that are new in 2007, you get a warning that some features will be lost (in fact you often seem to get that message even when it doesn't!), but that doesn't reach into VBA. Use say tables in VBA and save it as a 2003 file, and you won't see a problem until you run it in 2003.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  9. #9
    As a matter of fact, Tables in 2007 VBA are in fact ListObjects, which are mostly supported in 2003 too!
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  10. #10
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    357
    Location
    Well Guy

    This is just great, a lot of information to look into.

    Hence is it possible to maintain both Office 2003 & Office 2007 on a same machine..???

    So that I can code macro in office 2007 & test in office 2003...!!!!

    Thanks for all this info

    Sudhir


  11. #11
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    Yes, I have done it, but it is frustrating (ie: Had 03 in c:\Programs, and then when I tried in install 07 it wanted to just upgrade 03 but I Toold '07 to accessories folder, the problem with this is if you do somthing in '03 or '07 then close the app and go to the ofter office version you wili be presented with an intall progress bar, (your pc is acutuale updateing resources to the versian you want to use( this is y I said I have done it but its frustrating, )

  12. #12
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    357
    Location
    Thanks Trevor For the info.

    I think I better upgrade Office 03 to 07 & then Test the code developed on office 07 in office 03 in my office.

    Thanks
    to all.

  13. #13
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You could always create virtual machines and run 2003 in one, 2007 in another.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •