"Can't execute code in break mode" pops out everytime opening the new word file

Wenying Zhu 1 Reputation point
2021-02-01T14:28:32.547+00:00

Hello,
I am using Office 365 subscribed by the company. I forgot to close the "Visual Basic" tab once I closed the Word file. After that, a "Can't execute code in break mode" pops out every time when I open a new word file. I have attached the screenshot for the message I got. The first two lines were highlighted. It seems like there are some issues about these two code.

Private Sub m_app_WindowActivate(ByVal doc As Word.Document, ByVal wn As Word.Window)
If IsProtectedViewWindow Then Exit Sub

If m_app Is Nothing Or wt Is Nothing Then
initGlobals
End If
Call wt.WindowActivated(doc)
Call checkDocUserName
End Sub

I tried to uninstall the Office 365 and install it again. Unfortunately, the problem was not fixed.
Could you help me to figure out the solution for this issue?
Thank you!

Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
896 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erin Ding-MSFT 4,456 Reputation points
    2021-02-02T03:08:42.327+00:00

    @Wenying Zhu

    The error generally occurs when you tried to run code from the Macro dialog box but Visual Basic was already running code, although the code was suspended in break mode.
    Based on your description, this maybe relate to "forgot to close the "Visual Basic" tab once I closed the Word file".

    Please try to press the Break button in the Visual Basic Editor to check this issue.
    62733-image.png

    More information about this error, you could refer to "Can't execute code in break mode".

    Besides, tag "office-word-itpro" focuses on general issues about Word clients.
    If you would like to check if there is something wrong with your code and whether the code caused the error, it is suggested to add a tag "office-vba-dev".


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.