#1
|
|||
|
|||
Error 5852 when stepping through revisions
The following code works on documents with a moderate number of revisions. But on a document with 7672 revisions is raises a 5852 error on the 3448th revision. There is nothing wrong with this revision and adding or deleting previous revisions just moves the stopping point to another revision.
Code:
Sub StepRevisions() Dim Rv As Revision For Each Rv In ActiveDocument.Revisions RvType = Rv.Type Next Rv End Sub Furthermore, each time "For Each Rv In ...." is executed takes many seconds resulting in a very long processing time. One would expect that stepping through a collection would be fast. Code:
For k=1 to RvMax Set Rv = ActiveDocument.Revisions Can anyone help me with these problems? |
#2
|
||||
|
||||
It sounds like your memory is getting filled by repeatedly setting the value of RvType. What is the error message associated with 5852?
How is RvType defined? How are k and RvMax defined? Does it make a difference if you do a Save somewhere in the loop? eg after every 500 revs.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
The error message is Error 5852 Requested object is not available.
RvType and RvMax are defined as long. What makes a difference is to change the document View to Draft. The routine will thenstep through all 7672 revisions without the error message occurring. However, it still takes about 20 minutes in Word 2019 64 bit but only 50 seconds in Word 2016 32 bit. |
#4
|
||||
|
||||
Does it help speed it up and avoid errors if you also stop repagination and screen updates
Code:
Application.Options.Pagination = False Application.ScreenUpdating = False FWIW I have a strong dislike of Tracked Revisions and believe that tracking any more than about 100 of them in a single document is completely pointless. If you only track 'important' changes then tracked revisions have a real purpose (drawing attention to changes that NEED to be reviewed). If you track 7000 changes then no attention will be given to any more than the first page of changes. Word slows significantly with large numbers of tracked revisions and the likelihood of document corruption (or failing macros) increases significantly especially when multi-authoring in Sharepoint.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
|||
|
|||
Editor’s clients often insist on Track Changes and it is not uncommon to have over 7000 revisions in a large document. Besides, it indicates that the editor has earned their fee.
Turning off pagination only applies to Draft view and turning off screen updating does not solve the problem. I upgraded to Word 2021 and the problems disappeared. There is now no apparent limit to the number of revisions and the processing time for a particular document was reduced from 20 minutes to 44 seconds. Several users I have been in contact with have said that Word 2019 has become unstable following recent updates. It appears that bugs have been introduced and some of them involve revisions. My macros need to be run in different versions of Word. I could use compiler directives if I can determine work arounds for the 2019 problems. |
Tags |
error 5852, revisioms, word vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Revisions Sentences Word Count | Regev | Word VBA | 1 | 01-31-2018 01:06 PM |
How to open the Revisions pane? | billy8b8 | PowerPoint | 4 | 12-17-2014 04:22 PM |
stepping through a conversation | BobbyAre | Outlook | 1 | 04-29-2012 10:28 AM |
Code Error - Hiding comments and revisions | silvrwoman | Word VBA | 6 | 03-24-2012 10:15 PM |
Why run-time is always different from stepping into the codes? | tinfanide | Excel Programming | 1 | 03-04-2012 12:04 AM |