macro code made word 2013 freeze

  1. Posts : 333
    windows 10 pro build 21h2

    macro code made word 2013 freeze

    i wanted to check for duplicate text in my word file. it is possible by creating a macro in word and running it. i tried these things:-
    1) How to Find & Highlight Duplicate Sentences in MS Word | Get eSolutions
    2) How to find and highlight duplicate paragraphs in Word document?
    3) How to find duplicate content in Microsoft Word documents (doc, docx) GTechHub
    4) How to Find & Highlight Duplicate Sentences in MS Word at once

    each website has a different macro code for checking duplicates. all of them made word freeze when i clicked on run macro

    i just want to confirm that the freezing could be due to bug in the coding and it's not because the macro has coding which is malware related
      My Computer

  2. Posts : 3,279

    I just tried the macros listed in the first three links in Word 2010 ( I am usually weary of macros, but I couldn't see anything overtly malicious in them ), and all three of them worked, so there may be some other kind of error you are facing in your Word ( although I wouldn't know what - sorry).

    nb: Just for your information, I tried the macros tied in to just a single Word document rather than as a global template.
      My Computers

  3. Posts : 17,040
    Windows 10 Home x64 Version 22H2 Build 19045.4170

    The first two links deliberately turn off Word screen updates while the code is running so it avoids being slowed down by the need to update the display. They use the line
    Application.ScreenUpdating = False
    so the display is not updated again until this line near the end
    Application.ScreenUpdating = True

    If the code is hitting a problem midway and not finishing, it will appear as though Word is frozen. So just put a ' in front of the code and you might be able to figure out where the code is lingering / failing completely.
    'Application.ScreenUpdating = False

    If I am trying to identify a problem in code that does not produce obvious error symptoms, I just insert MsgBox lines to see how far it gets [it will not proceed past the MsgBox until you accept it so you have to sit there waiting]
    MsgBox "It gets this far"
    and I can get more info if I suspect a particular variable is not behaving as expected - if, say, a string variable called Fred is important at that stage of the code I could use this
    MsgBox "It gets this far and the value of Fred is " & Fred

    There are no similar lines in the third link but its code produced large numbers of false positives anyway so it hardly seems worth bothering with.

    {The fourth link is just the first one repackaged - it eventually takes you to the same place as the first link}

    Do note that the linked articles do provide for user questions so if you make no headway you can ask the authors what they think might be going wrong.

      My Computer


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 08:26.
Find Us

Windows 10 Forums