To answer some of the recent points i need to do a bit of a preamble
My earlier conditional compilation code written around 2011-14 was both over-complex but also in the wrong order. At the time I used
Code:#If VBA7 Then … #ElseIf Win64 Then … #Else … #End If
However using that meant the Win64 section never actually ran as all 64-bit Office versions used VBA7. Later I reversed the order before belatedly realising that the Win64 section wasn't usually necessary.
I wasn't alone in such contortions. For example arnelgp used to use
Code:#If VBA7 Then #If Win64 Then ... #Else ... #End if #Else ... #End If
He also now uses a simplified approach
Now for Office versions remember #Win64 is always a subset of #VBA7. The converse isn't necessarily true.
The OS version isn't directly relevant though of course whilst you can have 32 bit Office in 64-bit Windows, the reverse isn't possible.
So 64-bit Office always means #If Win64 is true. Otherwise its 32-bit Office even if the OS is 64-bit.
I hope that has clarified things rather than add to any possible confusion
Thanks a lot for all the help here
what made me confused is using the word [B"]Win"[/B]to refer to the Office version.
theDBguy pointed me to the correct explanation of this:
You distinguish the Office version by the way the compiler run the code