How to Use a 32-Bit VB6 COM DLL with 64-Bit Microsoft Access
Question details
The user needs to make a legacy 32-bit VB6 COM DLL work with a 64-bit version of Microsoft Access.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Attempting to load or reference a 32-bit COM component compiled in VB6 within a 64-bit Microsoft Access environment.
- Observed behavior
- The 64-bit version of Access cannot directly load or execute the 32-bit DLL, leading to reference errors and broken functionality.
Verify whether you have access to the original VB6 source code for the DLL, as most solutions require modifying or recompiling the original project files.
Compile the Component as an Out-of-Process ActiveX EXE
Convert your 32-bit DLL into an out-of-process ActiveX EXE so that 64-bit Access can communicate with it via cross-process COM.
A 64-bit host application cannot load a 32-bit in-process DLL into its memory. However, by changing the component to run as an independent executable (ActiveX EXE), Windows handles the communication between the 64-bit and 32-bit processes.
Launch Visual Basic 6 on your development machine and open the project file (.vbp) containing your COM DLL source code.
Navigate to the Project menu, select Project Properties, and change the Project Type dropdown from 'ActiveX DLL' to 'ActiveX EXE'.
Click File > Make [ProjectName].exe to compile the project. The resulting executable will automatically register itself on the development machine.
Open your 64-bit MS Access database, press ALT + F11 to open the VBA editor, and go to Tools > References to point to the newly registered ActiveX EXE.

Migrate COM Code Directly to Access VBA Modules
Move the underlying source code directly into Access to bypass external DLL dependencies entirely.
Rebuild the DLL for 64-Bit Using twinBASIC
Use a modern development environment like twinBASIC to compile a native 64-bit DLL from your existing VB6 code.
Try WPS Office for Seamless Document Management
While Microsoft Access handles complex database needs, WPS Office is the ideal lightweight alternative for your everyday Word, Excel, and PowerPoint files. Enjoy high performance and full compatibility with Microsoft Office formats without the heavy system requirements or legacy compatibility headaches.
- 1. Download the Installer: Visit the official WPS website and download the free installer for your operating system.
- 2. Install WPS Office: Run the setup file and follow the simple on-screen prompts to complete the installation.
- 3. Open Office Files: Launch WPS Office and open your existing .docx, .xlsx, or .pptx files directly with seamless format retention.

Frequently Asked Questions
Why does 64-bit MS Access reject my 32-bit VB6 DLL?
A 64-bit application process cannot load a 32-bit DLL directly into its memory space due to fundamental architectural differences in how Windows handles bitness. The application and the in-process DLL must match architectures.
What is an out-of-process ActiveX EXE?
An ActiveX EXE runs in its own memory space (process) rather than inside the host application's process. This separation allows a 64-bit host like MS Access to communicate safely with a 32-bit executable using cross-process COM.
Will I need to rewrite my VB6 code to use twinBASIC?
In most cases, twinBASIC provides near 100% backward compatibility with VB6 source code, meaning minimal to no rewrites are required to compile your legacy code as a modern 64-bit DLL.
Can I use Windows API calls in my migrated VBA code?
Yes, but if you migrate the code to 64-bit Access VBA, you must update the API declarations. You need to add the 'PtrSafe' keyword to your Declare statements and update data types holding pointers or handles to 'LongPtr'.




