K
Kevin
I have written some VBA code in an Excel 2003 workbook that also needs to be
accessible in Excel 2007, so the file format is 2003 (xls). Whenever I open
it in Compatibility Mode in 2007 and then try to save it the Compatibility
Checker pops up with warnings that I know will not cause problems for me. So,
I added the following line of code to suppress the Compatibility Checker:
ThisWorkbook.CheckCompatibility = False
This works great in Excel 2007, but I get a compile error when I open it in
2003 because the CheckCompatibility method is not supported in 2003.
My question is: Is there a way to somehow insulate this line of code so that
it is only compiled when the file is opened in 2007? Some sort of compiler
directive that conditionally compiles it based on the version? Or any other
ideas?
Thanks in advance for your help!
Kevin
accessible in Excel 2007, so the file format is 2003 (xls). Whenever I open
it in Compatibility Mode in 2007 and then try to save it the Compatibility
Checker pops up with warnings that I know will not cause problems for me. So,
I added the following line of code to suppress the Compatibility Checker:
ThisWorkbook.CheckCompatibility = False
This works great in Excel 2007, but I get a compile error when I open it in
2003 because the CheckCompatibility method is not supported in 2003.
My question is: Is there a way to somehow insulate this line of code so that
it is only compiled when the file is opened in 2007? Some sort of compiler
directive that conditionally compiles it based on the version? Or any other
ideas?
Thanks in advance for your help!
Kevin