PDA

View Full Version : Changing excel version with macros



bassam93
05-23-2023, 08:06 AM
If I opened the excel file in a different excel version, will I have the same macros I am using?

Jan Karel Pieterse
05-23-2023, 08:16 AM
You will have the same macros, but whether they work depends on whether the macro uses anything that the version in question supports or not.

Paul_Hossler
05-23-2023, 08:20 AM
Yes and no

The macros will (probably) be the same but MS is adding new features and functions all the time

So if you write a macro that uses features introduced with the latest version, it most likely won't work with an older version, but older version macros should work with a new version

Same for writing a 64 bit macro and then using it with 32 bit version of office


Conditional compile might help

https://stackoverflow.com/questions/14580969/conditional-compilation-based-on-excel-version

https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/understanding-conditional-compilation