Fix the Object Variable Not Set Error in Microsoft Word
Question details
The user needs to resolve an object variable or With block variable not set error in Word.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A Word document, the Normal template, or a global add-in may contain VBA code that triggers the error.
- Observed behavior
- Word displays an object variable or With block variable not set error.
Note whether the error appears when Word starts, when a particular document opens, or when a macro runs. The Safe Mode and keyboard instructions below apply to Word on Windows.
Test Word in Safe Mode and reset the Normal template
Use Safe Mode to narrow down the cause, then reset Normal.dotm if the template is suspected.
Close Word, press Windows+R, enter winword /safe, and select OK. Repeat the action that caused the error.
Close Word again. Press Windows+R, enter %appdata%\Microsoft\Templates, and select OK to open the templates folder.
In File Explorer, rename Normal.dotm to OldNormal.dotm. If that name already exists, choose another unused name.
Open Word normally and repeat the action. Word should create a fresh Normal.dotm template.

Check Word add-ins and VBA code for the error
Use this approach if resetting Normal.dotm does not help or the error occurs only with a specific document or macro.
Edit Word documents with WPS Writer
WPS Office is a free, lightweight alternative for everyday document editing. Its familiar interface and Microsoft Word format compatibility make it easier to move existing documents into a new workflow. It does not repair Microsoft Word's VBA error.

Frequently Asked Questions
What does the object variable not set error mean?
VBA error 91 usually means code is trying to use an object that has not been assigned or is Nothing. If the error dialog offers Debug, select it to inspect the highlighted code in the Visual Basic Editor.
Does Safe Mode tell me that Normal.dotm is broken?
No. On Windows, run winword /safe from the Run dialog to test Word without certain startup components. If the error disappears, investigate templates and add-ins separately.
Will resetting Normal.dotm delete my customizations?
Renaming Normal.dotm keeps the old file, but Word's new template will not automatically include its custom macros, styles, and other customizations. Keep the renamed file if you need to recover them.
How do I check whether an add-in is causing the error?
Open File > Options > Add-ins in Word, choose an add-in type from the Manage list, and select Go. Temporarily disable applicable add-ins, restart Word, and test whether the error returns.




