![]() |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
You can tell us which line is highlighted in Yellow when you choose debug.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#3
|
|||
|
|||
|
The highlighted line is
With ActiveWindow.View |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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.
|
|
| Tags |
| activewindow.view, error 91 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Variable Task Length aka "Time Zones"
|
DJM | Project | 2 | 11-25-2015 06:14 AM |
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 |
Create "Roll dice" simulation? (random number gen object?))
|
miiitchhh | PowerPoint | 1 | 10-14-2012 01:12 PM |
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 |