Tuesday, 13 October 2015

Word 2013 VBA runtime error 4605 on Read-only document

I recently converted my office PC from standalone WinXP and Office 2007 to Windows 8.1 and Office 2013 running in VirtulaBox on a Windows 7 host ... that's the content of another post in-the-writing ...
Having got everything working as I wanted, I went to run one of my VB automated Word templates but low-and-behold it threw an error on the first selection.find.execute statement it encountered.

To cut a long story short, I found web articles detailing the necessity to include the line of code which says:
ActiveWindow.View.ReadingLayout = False
This seemingly fixed the problem when I added it right at the start of my code

As soon  as I finished updating the code and put the document back into Read-only the error raised its ugly head again.

Again for brevity, the solution was to go into Word's File - Options and uncheck the option
"Open email attachments and other uneditable files in reading view" as per this MS article

No comments: