Enums for xlThemeColor are Incorrectly Named


Consider this scenario: You record a macro that applies theme colors to either cell backgrounds or fonts. When you open the VBA editor to modify the code, you find that the colors appear to have recorded incorrectly. The selections below record as follows:

Background1 (by default white) records as xlThemeColorDark1

Text1 (by default black) records as xlThemeColorLight1

Background2 (by default light grey) records as xlThemeColorDark2

Text2 (by default dark blue-grey) records as xlThemeColorLight2
Alternatively, if you write a macro manually, and use xlThemeColor enums, the results may be the opposite of what you intended.


This is a known issue with Excel VBA.


Since the recorded macros play back properly, there is no need to work around the issue. However, if you are writing a macro from scratch, use the results above as a guide for the correct enum to use.

Id. de artículo: 2781086 - Última revisión: 19 dic. 2012 - Revisión: 1