Others

Fix Word Run-Time Error 402 When Opening a UserForm

Natalie TaylorNatalie Taylor Nov 20, 2026 868 views

Question details

The user needs to resolve Word VBA run-time error 402 when displaying a UserForm.

Fix Word Run-Time Error 402 When Opening a UserForm
Product
Microsoft Word VBA
Device & OS
not provided
Scenario
A document or template uses event procedures to display a modal UserForm.
Observed behavior
Word displays run-time error 402 when procedures attempt to open a form while a modal UserForm is still active.
Before you start

Open the affected document or template in desktop Word and press Alt+F11 to inspect its VBA code. Ensure the file is in a macro-enabled format, such as .docm or .dotm, and enable macros only if you trust the file.

Solution 1Recommended

Remove Redundant UserForm Launches from Word Events

Use this approach when more than one event or procedure attempts to display the same modal UserForm.

Document_Open and Document_New are separate events: one runs when a document opens, and the other runs when a new document is created from a template. Keep the events you need, but prevent redundant calls from displaying the form again while it is active.

1
Find the event procedures

Press Alt+F11, then open the affected document or template's ThisDocument module in the Project Explorer. Locate Document_Open and Document_New and look for calls such as frmBid1.Show.

2
Check for repeated launches

Use Edit > Find in the VBA editor to search the project for the form's name and .Show calls. Check whether an event calls another procedure that also displays the form.

3
Disable the redundant call

In the relevant event procedure, comment out or remove the extra form.Show statement. For example, comment out the call in Document_Open if that launch is unnecessary; keep Document_New if it serves a separate purpose.

4
Test the document or template

Save the changes, close and reopen the document, or create a new document from the template using File > New. Confirm that the form opens only when intended and that error 402 no longer appears.

Remove Redundant UserForm Launches from Word Events
Keep event names intact: Word recognizes event procedures by their names. Renaming an event procedure prevents it from running automatically; remove only the launch that is not needed.
Free Microsoft Office alternative

Edit Word Documents with WPS Writer

WPS Office is a free, lightweight alternative with a familiar interface for editing documents and moving everyday work from Microsoft Office. It does not repair Word VBA errors or guarantee compatibility with Word macros and UserForms.

Open and edit Microsoft Word formats, including DOC and DOCXUse familiar document-editing tools for everyday writingWork with a free, lightweight Office alternativeMove ordinary documents between Office suites with ease
microsoft office alternative - wps office

Frequently Asked Questions

What causes Word VBA run-time error 402?

Error 402 can occur when code tries to perform an action that conflicts with an active modal UserForm. Check the form's Show calls and hide or unload the active form before displaying another form.

Where can I find Document_Open and Document_New?

Press Alt+F11 in desktop Word, then open the affected document or template's ThisDocument module in the VBA Project Explorer.

Should I delete both Document_Open and Document_New?

Not necessarily. Document_Open handles opening a document, while Document_New handles creating a document from a template. Remove or comment out only the redundant form launch after checking what each event does.

What is the difference between Me.Hide and Unload Me?

Me.Hide makes the form invisible while preserving its state. Unload Me closes the form and removes its state, so retrieve any values you need before unloading it.

Can WPS Office fix my Word VBA UserForm error?

No. Troubleshoot the VBA code in desktop Word. WPS Writer is an alternative for editing ordinary Word documents, but Word macros and UserForms are not guaranteed to work in it.