Share via

"Can't execute code in design mode" error message when starting Word 2010

Anonymous
2010-08-19T00:17:52+00:00

I just upgraded from Office XP to Office 2010. Now whenever I start Word I get the error message "Can't execute code in design mode." I want this to go away.

Microsoft 365 and Office | Install, redeem, activate | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-08-19T07:18:06+00:00

On Thu, 19 Aug 2010 00:17:52 +0000, My Annie wrote:

I just upgraded from Office XP to Office 2010. Now whenever I start Word I get the error message "Can't execute code in design mode." I want this to go away.

Look if there is something in the start-up folder or an add-in that is

interfering with Word. See:

http://support.microsoft.com/kb/921541


Gérard

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-04-27T20:28:20+00:00

    I encountered the same error message with design mode in another context. Every time I opened a document (that contains an AutoOpen procedure), I was told that code could not be executed in design mode.

     

    The following solution worked. Place this procedure in normal.dotm:

     

    Private Sub AutoOpen()

    Dim Index As Byte

    With ActiveDocument.VBProject

    For Index = 1 To .VBComponents.count

    With .VBComponents(Index)

    If .HasOpenDesigner Then .DesignerWindow.Close

    End With

    Next

    End With

    End Sub

     

    "Private" to ensure that there will be no conflict with other "AutoOpen" procedures.

     

    I found this code somewhere on the net. My only contribution is placing it universally functioning in Normal.dotm (and using "Byte" in stead of "Long").

     

    The funny thing is that after having closed and opened Word one or two times I could remove this piece of code from Normal.dotm - and the problem was gone.

     

    Best wishes

    HansJLassen

     

    I am trying to troubleshoot this same problem. I upgraded a user from 07 to 2010. Once I open normal.dotm where do I put this code???

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-01-23T08:33:13+00:00

    I encountered the same error message with design mode in another context. Every time I opened a document (that contains an AutoOpen procedure), I was told that code could not be executed in design mode.

    The following solution worked. Place this procedure in normal.dotm:

    Private Sub AutoOpen()

    Dim Index As Byte

    With ActiveDocument.VBProject

    For Index = 1 To .VBComponents.count

    With .VBComponents(Index)

    If .HasOpenDesigner Then .DesignerWindow.Close

    End With

    Next

    End With

    End Sub

    "Private" to ensure that there will be no conflict with other "AutoOpen" procedures.

    I found this code somewhere on the net. My only contribution is placing it universally functioning in Normal.dotm (and using "Byte" in stead of "Long").

    The funny thing is that after having closed and opened Word one or two times I could remove this piece of code from Normal.dotm - and the problem was gone.

    Best wishes

    HansJLassen

    Was this answer helpful?

    0 comments No comments