> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Check if VBA is Running in 64-bit Mode
- URL: https://nolongerset.com/is64bitvba/
- Published: 2021-12-21T03:11:05.000Z
- Updated: 2026-05-08T13:00:43.000Z
- Description: A simple function (or class property) that returns whether the VBA code is running under 32-bit mode or 64-bit mode.
- Author: Mike Wolfe
- Tags: Code Library, #clsApp, #Import 2026-05-20 02:59

This simple function will tell you whether the current VBA code is executing in 64-bit mode or 32-bit mode.

Please note that this code is checking the *VBA* bitness, not the *operating system* bitness. It is quite common for VBA to be running in 32-bit mode on a 64-bit Windows system.

While there are surely other uses for a function like this, I use it primarily as part of my automated error-logging routine.

## The Code: As Function

```vba
'Returns True if the user is running 64-bit *VBA*
'   This is *NOT* the same as the Windows bitness;
'   64-bit Windows can (and often does) run 32-bit VBA
Public Function Is64bitVba() As Boolean
    #If Win64 Then
        Is64bitVba = True
    #End If
End Function
```

The function makes use of the [Win64 compiler constant](https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/compiler-constants). That constant did not get introduced until VBA 7 (Access 2010). However, the above code will still work in earlier versions of VBA because unrecognized compiler constants evaluate to False.

## The Code: As Class Property

In my own code, I actually use `Is64bitVba` as a property within my global singleton class, [clsApp](https://nolongerset.com/vba-alchemy-turning-methods-into-properties/).

```vba
'Returns True if the user is running 64-bit *VBA*
'   This is *NOT* the same as the Windows bitness;
'   64-bit Windows can (and often does) run 32-bit VBA
Public Property Get Is64bitVba() As Boolean
    #If Win64 Then
        Is64bitVba = True
    #End If
End Property
```

Here are the two approaches in action from the Immediate window:

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2021/12/image-53.png)

Function call on top; class property on the bottom.

### External references

[Compiler constants (VBA)Office VBA reference topicMicrosoft Docso365devx![](https://docs.microsoft.com/en-us/media/logos/logo-ms-social.png)](https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/compiler-constants)

*Image by [1035352](https://pixabay.com/users/1035352-1035352/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=775506) from [Pixabay](https://pixabay.com/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=775506)*