Search notes:

VBA: 32-bit vs 64-bit

The longPtr data type is 4 bytes in a 32-bit environment (of Office) and 8 bytes in a 64-bit environment.
The longLong data type is only defined in 64-bit environments, see testing for 64-bit environments.
In a 64-bit environment, the compiler directive constant win64 is predefined, see also here.

ptrSafe keyword

The ptrSafe keyword makes sure that a can be safely run in a 64 bit-environment.
64-bit versions of Office (or the VBA runtime) require a declare statement to be decorated with ptrSafe.
I believe (but would like to have this confirmed or refuted) that the idea of ptrSafe is to force a developer to think about the data types that need to be adjusted when moving from 32 bit to 64 bit. By declaring a function with ptrSafe, the developer explicitly states that the necessary changes to longLong and longPtr have been performed.
The ptrSafe can be conditionally applied to a declare statement by using #if … then … #end if conditional compilation constructs:
#if vba7 then 
    declare ptrsafe sub … 
#else 
    declare         sub …
#endif

See also

The ptrSafe attribute of a declare statement.
In Visual Basic for Application, the bitness of the Office application can be determined with the win16, win32 and win64 predefined directive constants.
MS Office: 32 bit vs 64 bit
At least in Excel, the operatingSystem property of the application object returns a string (for example Windows (32-bit) NT 10.00) which allows to infer the bitness of the operating system that the code runs on.
WOW64

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759303746, '216.73.216.88', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/language/32-vs-64-bit/index(73): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78