Forum Discussion
mwidunn72
Sep 10, 2025Copper Contributor
How to fix "object/block variable not set" error in VBA?
I'm using VBA in Word 2013. My OS is Win10.
I'm having a problem with macros that I created that will no longer work. When I click to run them, I get: "Run-time error '91': Object variable or With block variable not set."
I have no idea what the problem could be. These macros ran fine before. Then, this started happening.
For example, here's a very simply-written one to zoom out in order to be able to see 5 pages at once in Word:
Sub Five_Page_View()
'
' Zoom 45% to see 5 pages
'
'
ActiveWindow.ActivePane.View.Zoom.Percentage = 45
End Sub
Used to work. Now, doesn't. I get the error above. Why?
Does anyone have any idea what the problem might be?
Thanks!
No RepliesBe the first to reply