W
Walt
Hi,
The last conditional compile related post I see was in 2005, so I'm
not optimistic there's a nice answer to this.
Let's say the user has installed Microsoft Office Compatibility Pack
for Word, Excel, and PowerPoint 2007 File Formats on an Office 2003
machine. If a user opens an Excel .xlsm file with a custom ribon
definition in Excel 2003, and saves it, it will be saved without it's
XML code and no longer be functional.
So, I put in an warning opening sheet/screen that I hide on workbook
open if application.version > 11. OK so far. So, user opens the
file in Excel 2003, sees the warning and closes the file. Without
thinking user clicks OK on closing query DG re. saving. File is
wrecked.
So, I put in a cancel = true if application.version < 12 in a workbook
before save sub. It won't run in Excel 2003 because all macros are
disabled by unrecognized variable types in the line 'Public Rib As
IRibbonUI' and, in the callbacks 'control As IRibbonControl' . The
user's inadvertant save proceeds to destroy the file.
QUESTIONS:
Can ribbon specific public and local variables and all the callback
code be placed in a #If, #Else, #EndIf conditional compile and hence
allow the backward compatible portion of the code to operate? What
constant would I use in the conditional compile? I see that VER is
not in the list of compiler constants.
Best Regards,
Walt
The last conditional compile related post I see was in 2005, so I'm
not optimistic there's a nice answer to this.
Let's say the user has installed Microsoft Office Compatibility Pack
for Word, Excel, and PowerPoint 2007 File Formats on an Office 2003
machine. If a user opens an Excel .xlsm file with a custom ribon
definition in Excel 2003, and saves it, it will be saved without it's
XML code and no longer be functional.
So, I put in an warning opening sheet/screen that I hide on workbook
open if application.version > 11. OK so far. So, user opens the
file in Excel 2003, sees the warning and closes the file. Without
thinking user clicks OK on closing query DG re. saving. File is
wrecked.
So, I put in a cancel = true if application.version < 12 in a workbook
before save sub. It won't run in Excel 2003 because all macros are
disabled by unrecognized variable types in the line 'Public Rib As
IRibbonUI' and, in the callbacks 'control As IRibbonControl' . The
user's inadvertant save proceeds to destroy the file.
QUESTIONS:
Can ribbon specific public and local variables and all the callback
code be placed in a #If, #Else, #EndIf conditional compile and hence
allow the backward compatible portion of the code to operate? What
constant would I use in the conditional compile? I see that VER is
not in the list of compiler constants.
Best Regards,
Walt