How to Fix Excel VBA UserForm Crashes Caused by FM20.DLL
Question details
The user needs to resolve an issue where Excel unexpectedly crashes when executing a VBA macro that modifies a UserForm control caption.

- Product
- Microsoft Excel
- Device & OS
- Windows
- Scenario
- Running or stepping through VBA code designed to change the text or caption of a UserForm label control.
- Observed behavior
- Excel crashes completely when the VBA code updates the UserForm control caption. The issue often persists even after saving and reopening, specifically pointing to FM20.DLL library issues or a corrupt workbook.
Before attempting to re-register system libraries or migrate your VBA code, verify whether your Windows operating system is 32-bit or 64-bit, as this dictates the exact folder path needed to locate the FM20.DLL Microsoft Forms library.
Test the UserForm and Rebuild the Corrupt Workbook
Use this method to determine if the workbook itself is corrupted and migrate your data to a stable file.
When Excel crashes consistently on a specific line of VBA code, such as changing a label caption, the underlying workbook or its VBA project structure may be corrupt. Testing the exact code in a brand-new, clean file helps isolate whether the problem is global or restricted to that single file.
Open Excel and click on 'File' > 'New' > 'Blank workbook' to start a fresh file.
Press the ALT + F11 keys on your keyboard simultaneously to open the Microsoft Visual Basic for Applications window.
In the VBA Editor, click 'Insert' from the top menu and select 'UserForm'. Add a basic Label control from the Toolbox to the form.
Double-click the UserForm to open its code module. Enter the code that caused the crash (e.g., UserForm1.Label1.Caption = "Test") and press F5 to run it.
If the code runs successfully in the new workbook without crashing, your original workbook is corrupt. You must rebuild your project by manually copying your spreadsheet data and pasting the VBA code into this new, uncorrupted workbook.

Verify and Re-Register the FM20.DLL Object Library
Check your VBA references to ensure the Microsoft Forms 2.0 Object Library is correctly mapped to your system's architecture.
Step Through VBA Code to Identify the Exact Crash Point
Stepping through your macro line-by-line helps confirm exactly which command forces the application to shut down.
Try WPS Office for a Stable, Crash-Free Spreadsheet Experience
If Microsoft Excel continues to crash due to corrupted workbooks or library errors, consider switching to WPS Office. It provides a lightweight, highly compatible alternative to Microsoft Office, supporting all major Excel formats with a smooth, familiar user interface.

Frequently Asked Questions
Why does changing a UserForm label caption crash Excel?
This crash typically occurs when the workbook's VBA project has become permanently corrupted, or if there is a conflict or missing reference to the Microsoft Forms 2.0 Object Library (FM20.DLL) required to render UserForm controls.
Where is the FM20.DLL file located on my computer?
On 32-bit Windows systems, the FM20.DLL file is located in the C:\Windows\System32 folder. On 64-bit Windows systems, the system places 32-bit library files, including FM20.DLL, into the C:\Windows\SysWOW64 folder.
Can I repair a corrupted Excel workbook containing VBA macros?
While Excel has a built-in 'Open and Repair' feature, deeply corrupted VBA projects and user forms often cannot be fully salvaged. The most reliable long-term solution is to rebuild the workbook by copying your raw data and rewriting or pasting the VBA code into a completely new file.




