Microsoft Office For Mac Difference Between 32 Bit And 64 Bit
Compatibility between the 32-bit and 64-bit versions of Office • • 11 minutes to read • Contributors • • • In this article Find out how the 32-bit version of Office is compatible with the 64-bit version of Office. Office applications are available in 32-bit and 64-bit versions. The 64-bit versions of Office enable you to move more data around for increased capability, for example when you work with large numbers in Microsoft Excel 2010. . When writing 32-bit code, you can use the 64-bit version of Office without any changes. However, when you write 64-bit code, you should ensure that your code contains specific keywords and conditional compilation constants to ensure that the code is backward compatible with earlier version of Office, and that the correct code is being executed if you mix 32-bit and 64-bit code.
There was one notable 64-bit holdout: Microsoft Office. Although Microsoft ported the Windows version of its Office software to 64-bit architecture long ago, Office for Mac remained 32-bit (Figure B). To find out whether your version of Office is 32-bit or 64-bit, click “About Word”. The version and build number are listed at the top of the About dialog box along with either “32-bit” or “64-bit”. Click “OK” to close the dialog box.
Visual Basic for Applications 7.0 (VBA 7) is released in the 64-bit versions for Office, and it works with both 32-bit and 64-bit applications. The changes described in this article apply only to the 64-bit versions of Office. Using the 32-bit versions of Microsoft Office enable you to use solutions built in previous versions of Office without further modifications. Note By default, when you install a 64-bit version of Office, you also install the 32-bit version is installed along with the 64-bit system. You must explicitly select the Microsoft Office 64-bit version installation option. In VBA 7, you must update existing Windows API statements ( Declare statements) to work with the 64-bit version.
Additionally, you must update address pointers and display window handles in user-defined types that are used by these statements. This is discussed in more detail in this article as well as compatibility issues between the 32-bit and 64-bit versions and suggested solutions. Comparing 32-bit and 64-bit systems Applications built with the 64-bit versions of Office can reference larger address spaces than 32-bit versions. This means you can use more physical memory for data than before, potentially reducing the overhead spent moving data in and out of physical memory In addition to referring specific locations (known as pointers) in physical memory, you can also use addresses to reference display window identifiers (known as handles).
The size (in bytes) of the pointer or handle depends on whether you're using a 32-bit or 64-bit system. If you want to run your existing solutions with the 64-bit versions of Office, be aware of the following: • Native 64-bit processes in Office cannot load 32-bit binaries. This is expected to be a common issue when you have existing Microsoft ActiveX controls and existing add-ins. • VBA previously didn't have a pointer data type, so you had to use 32-bit variables to store pointers and handles. These variables now truncate 64-bit values returned by API calls when using Declare statements. VBA 7 code base VBA 7 replaces the VBA code base in Office 2007 and earlier versions.
VBA 7 is available in both the 32-bit and 64-bit versions of Office. It provides two conditional compilation constants: • VBA7 - Helps ensure the backward compatibility of your code by testing whether your application is using VBA 7 or the previous version of VBA. • Win64 Tests whether code is running as 32-bit or 64-bit. With certain exceptions, the macros in a document that work in the 32-bit version of the application also work in the 64-bit version. ActiveX control and COM add-in compatibility Existing 32-bit ActiveX controls, are not compatible with the 64-bit versions of Office. For ActiveX controls and COM objects: • If you have the source code, generate a 64-bit version yourself.
• If you don't have the source code, contact the vendor for an updated version. Native 64-bit processes in Office cannot load 32-bit binaries. This includes the common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) and the controls of MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar). These controls were installed by 32-bit versions of Office earlier than Office 2010. You'll need to find an alternative for your existing VBA solutions that use these controls when you migrate the code to the 64-bit versions of Office. API compatibility The combination of VBA and type libraries gives you lots of functionality to create Office applications.
However, sometimes you must communicate directly with the computer's operating system and other components, such as when you manage memory or processes, when working with UI elements linke windows and controls, or when modifying the Windows registry. In these scenarios, your best option is to use one of the external functions that are embedded in DLL files. You do this in VBA by making API calls using Declare statements. Note Microsoft provides a Win32API.txt file that contains 1,500 Declare statements and a tool to copy the Declare statement that you want into your code. However, these statements are for 32-bit systems and must be converted to 64-bit by using the information discussed later in this article. Existing Declare statements won't compile in 64-bit VBA until they've been marked as safe for 64-bit by using the PtrSafe attribute. You can find examples of this type of conversion at Excel MVP Jan Karel Pieterse's website at.
The is a useful tool to inspect the syntax of API Declare statements for the PtrSafe attribute, if needed, and the appropriate return type. . Declare statements resemble one of the following, depending on whether you are calling a subroutine (which has no return value) or a function (which does have a return value). Public/Private Declare Sub SubName Lib 'LibName' Alias 'AliasName' (argument list) Public/Private Declare Function FunctionName Lib 'Libname' alias 'aliasname' (argument list) As Type The SubName function or FunctionName function is replaced by the actual name of the procedure in the DLL file and represents the name that is used when the procedure is called from VBA code. You can also specify an AliasName argument for the name of the procedure. The name of the DLL file that contains the procedure being called follows the Lib keyword. And finally, the argument list contains the parameters and the data types that must be passed to the procedure. The following Declare statement opens a subkey in the Windows registry and replaces its value.