PDA

View Full Version : Solved: Compatibility of Macros coded in 2007



kbsudhir
03-25-2008, 02:36 PM
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

:think:

Thanks
Sudhir

Bob Phillips
03-25-2008, 02:50 PM
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.

Trevor
03-25-2008, 03:00 PM
or you could incorperate late binding to auto add/remove libraries(refrences) so that it' will be compatible

Bob Phillips
03-25-2008, 03:45 PM
How will a library reference help if you use some part of the object model that doesn't exist in excel 2003?

Trevor
03-25-2008, 04:23 PM
your right, I am assuming that just by chance kbsubhir won't use a lib ref that doesn't exist in 03

Bob Phillips
03-25-2008, 04:29 PM
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.

Trevor
03-25-2008, 06:24 PM
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.

Bob Phillips
03-26-2008, 01:14 AM
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.

Jan Karel Pieterse
03-26-2008, 04:17 AM
As a matter of fact, Tables in 2007 VBA are in fact ListObjects, which are mostly supported in 2003 too!

kbsudhir
03-26-2008, 06:51 AM
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

:thumb :clap:

Trevor
03-27-2008, 07:48 AM
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, )

kbsudhir
03-30-2008, 12:15 AM
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.

Bob Phillips
03-30-2008, 02:10 AM
You could always create virtual machines and run 2003 in one, 2007 in another.