A family of Microsoft word processing software products for creating web, email, and print documents.
Could you share us a screenshot of that error message? It will help to reproduce your issue and narrow down the cause.
The situation you mentioned is related to VBA code, you can refer to this article: Office VBA support and feedback | Microsoft Docs to go to Stack Overflow by using the VBA tag, along with any other relevant tags as there are also many experienced engineers and experts in the forums there.