| Start | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Changing code behavior at compile time The This results in the value of #Const Scope The Pre-defined Constants Some compilation constants are already pre-defined. Which ones exist will depend on the bitness of the office version you're running VBA in. Note that Vba7 was introduced alongside Office 2010 to support 64 bit versions of Office.
Note that Win64/Win32 refer to the Office version, not the Windows version. For example Win32 = TRUE in 32-bit Office, even if the OS is a 64-bit version of Windows. |
||||||||||||||||||||||||||||
Using Declare Imports that work on all versions of Office This can be simplified a bit depending on what versions of office you need to support. For example, not many people are still supporting 16 bit versions of Office. The last version of 16 bit office was version 4.3, released in 1994 (opens new window), so the following declaration is sufficient for nearly all modern cases (including Office 2007). If you don't have to support anything older than Office 2010, this declaration works just fine. |
Read Article
https://develop.horje.com/learn/1434/reference