Design mode value for excel vsto RRS feed

  • Question

  • I have created a WPF Custom Control to be hosted in the Excel worksheet. The control can have different behaviors in the design and runtime. For this purpose, it is required to know the current mode of excel, i.e. the value of the design mode switch in the developer tab. Is there any way to achieve this feature in excel vsto?

    Monday, January 21, 2013 5:25 AM


  • The only way I know of that could work is

    Debug.Print CommandBars.GetPressedMso("DesignMode")

    Which should return the current state of that toggle button.

    However, when I try a quick test of this as VBA code it only returns false, as code cannot run when Design Mode is active. So Design Mode is turned off when (VBA) code is run to determine the state. You'll have to see whether it works in your particular scenario.

    Cindy Meister, VSTO/Word MVP, my blog

    Monday, January 21, 2013 4:52 PM