In Excel's VBA project, process the WORD document, get the run-time error: 4605.

informationVBA 41 Reputation points
2021-11-24T13:38:09.14+00:00
  1. the error reporting VBA code is:
    mydoc.revisions.acceptall 'mydoc is my word object the error code is: 4605
    the error description is in Chinese, I translate it as: the method or feature is invalid, as the command can't be used to read.
  2. on my computer there is no error reported, but on three others' computer, they get the same error.
  3. our windows version are same. our office versions are same: office 16.0
  4. our VBA project configuration is same: menu: tools -> reference, we selected the same excel object library, word object library, etc
    1. I want to know is there any configuration items to be configed on the computers?

Thanks.

Microsoft 365 and Office | Word | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. John Korchok 6,126 Reputation points
    2021-11-25T00:38:16.937+00:00

    Just before mywddoc.Revisions.AcceptAll, add a line:

    ActiveWindow.ActivePane.View.Type = wdPrintView


2 additional answers

Sort by: Most helpful
  1. informationVBA 41 Reputation points
    2021-11-24T13:45:11.287+00:00
    1. our VBA project configuration is same: menu: tools -> reference, we selected the same excel object library,

    word object library, etc

    0 comments No comments

  2. John Korchok 6,126 Reputation points
    2021-11-24T18:38:00.653+00:00

    Posting more of your code would help with diagnosis. One circumstance that can raise that error is if the Word document is opened with an incompatible view. The document should be in **Print Layout* view, Read Mode or Web Layout view will cause an error.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.