Computers running 64-bit versions of Windows generally have more resources such as processing power and memory, than their 32-bit predecessors. Also, 64-bit applications can access more memory than 32-bit applications (up to 18.4 million Petabytes). Therefore, if your scenarios include large files and/or working with large data sets and your computer is running 64-bit version of Windows, 64-bit is the right choice when:
You're using add-ins with Outlook, Excel, or other Office apps. While 32-bit applications can work with add-ins, they can use up a system's available virtual address space. With 64-bit apps, you have up to 128 TB of virtual address space which the app and any add-ins running the same process can share. With 32-bit apps, you might get as little as 2 GB of virtual address space which in many cases isn't enough and can cause the app to stop responding or crash.
You have 32-bit COM Add-ins with no 64-bit alternative. You can continue to run 32-bit COM add-ins in 32-bit Microsoft 365 on 64-bit Windows. You can also try contacting the COM Add-in vendor and requesting a 64-bit version.
You have 32-bit MAPI applications for Outlook. With a growing number of 64-bit Outlookcustomers, rebuilding 32-bit MAPI applications, add-ins, or macros for 64-bit Outlook is the recommended option, but if needed you can continue to run them with 32-bit Outlook only, as well. To learn about preparing Outlook applications for both 32-bit and 64-bit platforms, see Building MAPI Applications on 32-Bit and 64-Bit Platforms and the Outlook MAPI Reference.
You need 32-bit Microsoft Access .mde, .ade, and .accde database files. While you can recompile 32-bit .mde, .ade, and .accde files to make them 64-bit compatible, you can continue to run 32-bit .mde, .ade, and .accde files in 32-bit Access.
You need 32-bit Microsoft Access.mde, .ade, and .accde database files. While you can recompile 32-bit .mde, .ade, and .accde files to make them 64-bit compatible, you can continue to run 32-bit .mde, .ade, and .accde files in 32-bit Access.
You work with extremely large data sets, like enterprise-scale Excel workbooks with complex calculations, many pivot tables, connections to external databases, and using Power Pivot, Power Map, or Power View. The 64-bit version of Microsoft 365 may perform better for you.
You have 32-bit MAPI applications for Outlook. With a growing number of 64-bit Outlook customers, rebuilding 32-bit MAPI applications, add-ins, or macros for 64-bit Outlook is a recommended option. To learn more about preparing Outlook applications for both 32- and 64-bit platforms, see Building MAPI applications on 32-Bit and 64-Bit Platforms and the Outlook MAPI Reference.
Your organization requires that Hardware Data Execution Prevention (DEP) be enforced for Microsoft 365 applications. DEP is a set of hardware and software technologies that some organizations use to enhance security. For 64-bit installations DEP will always be enforced, while on 32-bit installations DEP needs to be configured through settings.
With more Outlook customers using 64-bit, rebuilding 32-bit Messaging Application Programming Interface (MAPI) applications, add-ins, or macros for 64-bit Outlook is the recommended option. But if necessary you can also continue to run them with 32-bit Outlook only.
If your organization needs to continue to use extensions to Microsoft 365, such as ActiveX controls, third-party add-ins, in-house solutions built on previous versions of Microsoft 365, or 32-bit versions of software that interface directly with Microsoft 365, we recommend you go with the automatically installed 32-bit (x86) Office 2010 on computers that are running both 32-bit and 64-bit supported Windows operating systems.
You use 32-bit controls with no 64-bit alternative. You can continue to run 32-bit controls in 32-bit Microsoft 365 like Microsoft Windows Common Controls (Mscomctl.ocx, comctl.ocx), or any existing third-party 32-bit controls.
In 99% of the cases, that just means one thing when this exception is raised in a 64-bit program. The "incorrect format" is a DLL that contains 32-bit code. That cannot work, a 64-bit program can only load 64-bit DLLs.
Microsoft Visual Basic for Applications (VBA) is the version of Visual Basic that ships with Microsoft Office. In Microsoft Office 2010, VBA includes language features that enable VBA code to run correctly in both 32-bit and 64-bit environments.
By default, Office 2010, 2013 and 2016 install the 32-bit version. You must explicitly choose to install the 64-bit version during setup. Starting with Office 2019 and Microsoft 365, the default is the 64-bit version.
Running VBA code that was written before the Office 2010 release (VBA version 6 and earlier) on a 64-bit platform can result in errors if the code is not modified to run in 64-bit versions of Office. Errors will result because VBA version 6 and earlier implicitly targets 32-bit platforms, and typically contains Declare statements that call into the Windows API by using 32-bit data types for pointers and handles. Because VBA version 6 and earlier does not have a specific data type for pointers or handles, it uses the Long data type, which is a 32-bit 4-byte data type, to reference pointers and handles. Pointers and handles in 64-bit environments are 8-byte 64-bit quantities. These 64-bit quantities cannot be held in 32-bit data types.
The problem with running legacy VBA code in 64-bit Office is that trying to load 64-bits into a 32-bit data type truncates the 64-bit quantity. This can result in memory overruns, unexpected results in your code, and possible application failure.
To address this problem and enable VBA code to work correctly in both 32-bit and 64-bit environments, several language features have been added to VBA. The table at the bottom of this document summarizes the new VBA language features. Three important additions are the LongPtr type alias, the LongLong data type, and the PtrSafe keyword.
LongPtr. VBA now includes the variable type alias LongPtr. The actual data type that LongPtr resolves to depends on the version of Office that it is running in; LongPtr resolves to Long in 32-bit versions of Office, and LongPtr resolves to LongLong in 64-bit versions of Office. Use LongPtr for pointers and handles.
LongLong. The LongLong data type is a signed 64-bit integer that is only available on 64-bit versions of Office. Use LongLong for 64-bit integrals. Conversion functions must be used to explicitly assign LongLong (including LongPtr on 64-bit platforms) to smaller integral types. Implicit conversions of LongLong to smaller integrals are not allowed.
All Declare statements must now include the PtrSafe keyword when running in 64-bit versions of Office. It's important to understand that simply adding the PtrSafe keyword to a Declare statement only signifies that the Declare statement explicitly targets 64-bits. All data types within the statement that need to store 64-bits (including return values and parameters) must still be modified to hold 64-bit quantities.
Declare statements with the PtrSafe keyword is the recommended syntax. Declare statements that include PtrSafe work correctly in the VBA7 development environment on both 32-bit and 64-bit platforms.
Consider the following Declare statement examples. Running the unmodified Declare statement in 64-bit versions of Office will result in an error indicating that the Declare statement does not include the PtrSafe qualifier. The modified VBA example contains the PtrSafe qualifier, but notice that the return value (a pointer to the active window) returns a Long data type. On 64-bit Office, this is incorrect because the pointer needs to be 64-bits. The PtrSafe qualifier tells the compiler that the Declare statement is targeting 64-bits, so the statement executes without error. But because the return value has not been updated to a 64-bit data type, the return value is truncated, resulting in an incorrect value returned.
To reiterate, you must modify the Declare statement to include the PtrSafe qualifier, and you must update any variables within the statement that need to hold 64-bit quantities so that the variables use 64-bit data types.
Following is a VBA Declare statement example that is modified to include the PtrSafe keyword and is updated to use the proper 64-bit (LongPtr) data type:
df19127ead