VBA UserForms are one of the most powerful features in Excel workbooks — and one of the most fragile after migration. The good news: when you convert .xls to .xlsm correctly, UserForms survive. The form structure, controls layout, and event code all migrate with the VBA project.
The less good news: forms can still break in specific ways that aren't obvious until someone tries to open one. This guide covers exactly what can fail and how to diagnose and fix each issue.
This trips up a lot of migrations. If you convert a macro-containing .xls file to .xlsx, everything is stripped — macros, UserForms, class modules, all of it. .xlsx is the macro-free XML format. It cannot contain VBA.
Files with UserForms must be converted to .xlsm — the macro-enabled workbook format. This is where the VBA project lives after migration.
LegacyLeaps detects the presence of VBA during scan and automatically converts macro-containing files to .xlsm rather than .xlsx. If you're using PowerShell or a cloud converter, verify you're using format constant 52 (xlOpenXMLWorkbookMacroEnabled), not 51.
When you convert .xls to .xlsm correctly, the following UserForm elements survive intact:
If your UserForms use only native VBA controls, they will very likely work after migration with no changes needed. The main risks are in the next section.
"Could not load an object because it is not available on this machine"
Some older .xls workbooks embed non-native ActiveX controls in UserForms — third-party calendar pickers, ListView/TreeView controls (MSComCtl.ocx), progress bars (MSComCtl2.ocx), or data grid controls.
These controls are registered in the Windows registry as COM objects. If the OCX file isn't registered on the migration target machine, the form fails to load.
Diagnosis: Open the VBE (Alt+F11), double-click the UserForm, and look at which controls are on the canvas. Right-click a form, select Properties, and look for controls with a small triangle icon — these are COM-based controls that need external registration.
Fix options:
regsvr32 C:\Windows\SysWOW64\MSCOMCTL.OCX (32-bit on 64-bit Windows)"Can't find project or library" / compile error on UserForm open
UserForms that use features from referenced libraries (ADO, DAO, Microsoft Scripting Runtime, etc.) break if those references are marked "MISSING" after migration. References become missing when the library version changes between Office versions.
Diagnosis: In the VBE, go to Tools → References. Look for items marked "(MISSING)". Note the library name and version.
Fix: Uncheck the missing reference. Find and check the same library at the correct version for the target Office installation. Or rewrite the code to use late binding instead of early binding — this removes the reference requirement entirely:
' Early binding (requires reference) — breaks when library version changes
Dim rs As ADODB.Recordset
' Late binding (no reference needed) — survives across Office versions
Dim rs As Object
Set rs = CreateObject("ADODB.Recordset")
"The code in this project must be updated for use on 64-bit systems"
UserForms that include Declare statements in their module (direct Windows API calls) need PtrSafe updates for 64-bit Office. This is the same issue as standard modules, but it can also appear in form code.
Typical pattern (old code):
' Breaks in 64-bit Excel
Private Declare Function GetTickCount Lib "kernel32" () As Long
Fixed:
' Works in both 32-bit and 64-bit
#If VBA7 Then
Private Declare PtrSafe Function GetTickCount Lib "kernel32" () As Long
#Else
Private Declare Function GetTickCount Lib "kernel32" () As Long
#End If
LegacyLeaps scans all VBA modules — including UserForm code modules — for Declare statements and updates them for 64-bit compatibility during migration.
Many UserForms populate ListBoxes, ComboBoxes, or other controls from sheet ranges in their UserForm_Initialize event. If the migration changed sheet names, range addresses, or named range definitions, the initialization code silently fails — the form opens but controls are empty.
Diagnosis: Add error handling to the Initialize event temporarily, or step through it in the VBE debugger to see where population fails.
Fix: Update range references in the Initialize event to match the new sheet/range structure. Use named ranges instead of cell addresses where possible — they're more resilient to structural changes.
Run this checklist for every workbook with UserForms after migration:
The best time to identify UserForm risks is before migration, not after. The VBE immediate window can list all forms and their control types:
Sub AuditUserForms()
Dim vbComp As VBIDE.VBComponent
Dim ctrl As MSForms.Control
Dim output As String
For Each vbComp In ThisWorkbook.VBProject.VBComponents
If vbComp.Type = 3 Then ' vbext_ct_MSForm
output = output & vbComp.Name & ":" & vbCrLf
For Each ctrl In vbComp.Designer.Controls
output = output & " " & ctrl.Name & " (" & TypeName(ctrl) & ")" & vbCrLf
Next ctrl
End If
Next vbComp
MsgBox output
End Sub
This lists every form and control type. Any control that shows a TypeName that isn't a standard MSForms type (TextBox, Label, CommandButton, etc.) is likely a COM control that needs attention.
LegacyLeaps's scan identifies UserForms with ActiveX controls and non-native dependencies — before you convert. No surprises post-migration.
Try the Free ScanPart of the Complete Guide to Legacy Excel Migration.
Related Articles
Practical fixes for legacy Excel and Access problems. No spam.