Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2016, 01:35 PM
barry_burd barry_burd is offline ActiveWindow.View "object variable not set" Windows 10 ActiveWindow.View "object variable not set" Office 2016
Novice
ActiveWindow.View "object variable not set"
 
Join Date: May 2016
Posts: 3
barry_burd is on a distinguished road
Default ActiveWindow.View "object variable not set"

I'm getting the error "Object variable or With block variable not set" when I try to run the following macro on Word 2016 on a Mac:



Sub MarkupToggle()
With ActiveWindow.View
.ShowRevisionsAndComments = Not .ShowRevisionsAndComments
.RevisionsView = wdRevisionsViewFinal
End With
End Sub

How can I diagnose this error?
Reply With Quote
  #2  
Old 05-30-2016, 03:57 PM
Guessed's Avatar
Guessed Guessed is offline ActiveWindow.View "object variable not set" Windows 10 ActiveWindow.View "object variable not set" Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can tell us which line is highlighted in Yellow when you choose debug.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 05-30-2016, 04:28 PM
barry_burd barry_burd is offline ActiveWindow.View "object variable not set" Windows 10 ActiveWindow.View "object variable not set" Office 2016
Novice
ActiveWindow.View "object variable not set"
 
Join Date: May 2016
Posts: 3
barry_burd is on a distinguished road
Default

The highlighted line is

With ActiveWindow.View
Reply With Quote
  #4  
Old 05-30-2016, 05:22 PM
Guessed's Avatar
Guessed Guessed is offline ActiveWindow.View "object variable not set" Windows 10 ActiveWindow.View "object variable not set" Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Which would indicate that the Mac version of Word 2016 doesn't have either an ActiveWindow or if it does, the ActiveWindow doesn't have a View property.

Have you tried recording a macro to see what is created when you toggle the revisions visibility or set the revisions to display as final?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 05-30-2016, 05:38 PM
barry_burd barry_burd is offline ActiveWindow.View "object variable not set" Windows 10 ActiveWindow.View "object variable not set" Office 2016
Novice
ActiveWindow.View "object variable not set"
 
Join Date: May 2016
Posts: 3
barry_burd is on a distinguished road
Default

Moving the Sub from Normal's "This Document" to Normal's "New Macros" fixed the problem. I guess it's because "This Document" confuses the ActiveWindow.View property.
Reply With Quote
Reply

Tags
activewindow.view, error 91



Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveWindow.View "object variable not set" Variable Task Length aka "Time Zones" DJM Project 2 11-25-2015 06:14 AM
ActiveWindow.View "object variable not set" Myterious "container object" showing up spontaneously in table cells kritz Word Tables 6 06-14-2014 08:16 PM
When composing an e-mail how do I add "Page Layout" and "View" tabs to the ribbon CensorTilSin Outlook 1 12-11-2013 12:05 PM
ActiveWindow.View "object variable not set" Create "Roll dice" simulation? (random number gen object?)) miiitchhh PowerPoint 1 10-14-2012 01:12 PM
ActiveWindow.View "object variable not set" replace data from variable with "sub and super script" from excel to word by vba krishnaoptif Word VBA 9 06-22-2012 05:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft