Title: Running VBA in AutoCAD 2013 (64-bit): The Module Fix and Legacy Gotchas Posted by: [Your Name] | Category: CAD Customization If you recently upgraded (or were forced to upgrade) to AutoCAD 2013 64-bit and tried to run your old VBA macros, you likely hit this error: “The VBA module is not installed. Please download and install the VBA module for your AutoCAD version.” Don’t panic. Your old .dvb files aren’t broken. The problem is simple: AutoCAD 2013 does not ship with VBA enabled by default. Autodesk deprecated VBA starting with the 2010 release, and from 2011–2013, it became a separate, optional download. Here is the fix and what you need to know about 64-bit compatibility. Step 1: Install the Correct VBA Module You cannot use the AutoCAD 2010 or 2012 VBA enabler on 2013. You need the specific one. Download: Search for “AutoCAD 2013 VBA Enabler Module” on Autodesk’s official site (or use the direct link from Autodesk Subscription). The file is typically named: AutoCAD_2013_VBA_Enabler_64bit.exe Installation order:
Install AutoCAD 2013 (64-bit). Install any Service Packs (SP1, SP2) for AutoCAD 2013 first . Run the VBA Enabler as Administrator (right-click → Run as Administrator ).
Step 2: The 64-Bit Trap – Declare Statements Even after installing the module, your macros might crash. The reason? Pointer size and Long data types. In 32-bit VBA, a handle or memory address fits in a Long (4 bytes). In 64-bit, it requires LongLong or LongPtr . The fix (critical for API calls): Change all Windows API declarations to work with 64-bit. Old 32-bit code: Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
New 64-bit compatible code (use PtrSafe and LongPtr ): Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr autocad 2013 vba module 64-bit
Rule of thumb: Any Declare statement needs PtrSafe . Any variable storing a handle or pointer needs LongPtr . If you skip this, AutoCAD will either crash silently or throw a “Bad DLL calling convention” error. Step 3: Testing Your Environment Once the VBA Enabler is installed, you can test it:
In AutoCAD, type VBAMAN at the command line. If the VBA Manager dialog opens, you are good. Load your .dvb file and try a simple macro (e.g., MsgBox "Hello" ).
The Reality Check (2025+ Perspective) Even though this works, consider this a bridging solution . Autodesk officially ended support for VBA in AutoCAD 2013 a long time ago. Pros: Title: Running VBA in AutoCAD 2013 (64-bit): The
Legacy drawing automation runs without rewriting. No need to convert 10,000 lines of code overnight.
Cons:
No new VBA features from Microsoft. Security warnings (antivirus often quarantines VBA enablers). You cannot debug 64-bit API calls easily. The problem is simple: AutoCAD 2013 does not
Final Verdict Yes, you can run VBA macros on AutoCAD 2013 64-bit by installing the separate VBA Enabler module. However, always audit your Declare statements for PtrSafe and LongPtr . If your macros only manipulate AutoCAD’s object model (no external Windows API calls), they will likely run without changes. Pro tip: For new projects, learn .NET (C#) or LISP. For keeping old drawings alive, this fix works perfectly. Have a stubborn macro that still fails after installing the enabler? Drop the error code in the comments below.
The AutoCAD 2013 64-bit VBA module is an external add-on required to run macros, as the VBA engine is not included in the standard installation. Users must download and run the 64-bit VBA Enabler, executing the installer while AutoCAD is closed, to enable tools like VBARUN and VBAIDE. For installation instructions and related resources, visit the CSDN blog article. Drawing Circles In AutoCAD Using Excel & VBA