View Single Post
 
Old 03-04-2019, 03:03 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

If the code is running into memory issues but appearing to do the right thing then you could maybe modify the counter to exit the sub after 50 replacements.

If the resulting doc is fine then save the doc and run it again and see if that is also OK.

After a couple of successful runs, you could change the number to 100 or higher. Starting the macro 7 times is a whole lot better than never getting a result.

Perhaps throwing in a Save would clear the memory instead of doing the DoEvents.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote