
Thank you for posting your question on the Q&A forum regarding the VBA macro error in Microsoft Word for Mac. I totally understand how confusing this must be, especially when something that used to work perfectly suddenly starts throwing errors. Based on my research, there’s a possibility that the error may not consistently occur depending on how the macro is triggered. Some users have reported that this issue often arises when working with Forms, and it has also been observed on Windows OS. Here are a few suggestions that may help you troubleshoot the issue:
- Try Opening Word in Safe Mode: This can help isolate whether the issue is caused by add-ins or other startup items. How to use a "clean startup" to determine whether background programs are interfering with Office for Mac
- Save the Document Locally: Try saving the document to your local drive and then run the macro again. Some users have found this resolves the issue.
- Check VBA Reference Libraries: In the VBA editor, go to Tools > Preferences... and try deactivating libraries one by one to see if the error is linked to a specific reference.
- Test in a New Document: Create a new Word document, paste your macro code into it, and test again. This can help determine whether the issue lies with the code itself or a corruption in the original file.
- Delay Macro Execution It’s possible the macro is trying to run before the document or UserForm is fully loaded. You can try calling your macro from another subroutine using
Application.OnTime
, with a delay of about 10 seconds, to see if the issue persists. https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word._application.ontime?view=word-pia
This example executes the macro named ‘Macro1’, which includes the project and module name, exactly 10 seconds after the example is run.
Application.OnTime When:=Now + TimeValue("00:00:10"), _ Name:="Project1.Module1.Macro1"
Please understand that our initial reply may not always immediately resolve the issue. However, with your help and more detailed information, we can work together to find a solution.
Looking forward to hearing back from you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.