View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 230
Default forwards/backward compatibility Excel 2003-2007

On 31/01/2012 21:41, c1802362 wrote:
I posted on a similiar topic yesterday about code running fine on
Excel 2003/XP and not running on Excel 2007/Win7.

Well, I got everything to run on 2007 if the Excel 2003 file is saved
in .xlsm format (xlsx bombs)

Now the problem is the .xlsm file sent back to Excel 2003 loads fine,
except the custom menu pulldown can no longer find the macros linked
to it. If the user launches the macros from the the Tools/Macro/Macros
path, everything works fine. However, the custom menu on the menubar
is broken.

So, to recap. The .xls file runs fine on Excel 2003, but the not on
2007. The .xlsm file runs fine on 2007, but not on 2003. The code is
identical in both versions.

Does anyone have a method to enable cross version compatibility (so
that I only relelase and maintain one file) or do I have to caution
the user base to use a version aligned to their version of Excel (and
distribute .xls and .xlsm versions)?


Ways and means to isolate the unfortunate incompatibilities inside
modules that are only called after checking that you are running the
right version of Excel have been discussed here before. But if you use
any significant number of graphical objects you will go quite quite mad
trying to have one version that works on both platforms.

Early versions of XL2007 had a number of race conditions in charting
that made it almost impossible to run old XL2003 VBA code on it even if
the code was notionally correct. That is you could have code which would
work on 2007 if you stepped through in the debugger or added judicious
waits, but put it on a faster PC and all hell broke loose.

I chose to fork the distribution to retain my sanity.

--
Regards,
Martin Brown