You are currently offline, waiting for your internet to reconnect

Parts of Excel turn white or gray when you run VBA code in Excel 2013

When you run Microsoft Visual Basic for Applications (VBA) code in Microsoft Excel 2013, portions of Excel may appear white or gray, depending on your Office Theme. It stays blank until the code completes. This issue may occur if the VBA code performs one or more of the following actions in a macro that runs long enough for the user to see the results before the macro completes:
  • Repeatedly select cells
  • Insert sheets
  • Update or opens task panes
  • Add a workbook

This issue is caused by the changes that are made in Microsoft Office 2013 to optimize the new graphics engine.
  1. Use ScreenUpdating to disable the screen updates of Excel so you do not see the changes while they are disabled. This also may improve your macro performance.
    Application.ScreenUpdating = FalseWorkooks.AddApplication.ScreenUpdating = True
  2. If you need to see the screen changes, insert a DoEvents command after the line in the code that causes the screen to appear white. Using DoEvents sparingly will help maintain macro performance.

This is a known lmitation in Excel 2013.

Note: For all versions of Excel, a similar effect can occur in long running macros when Windows turns the application white and marks it not responding. This occurs because Excel is not responding to Windows while the macro is running. DoEvents will also assist in this scenario by allowing Excel to respond to Windows and allow the application screen to recover.


Article ID: 2790615 - Last Review: 02/01/2013 21:35:00 - Revision: 4.0

Microsoft Excel 2013

  • kbsurveynew kbexpertiseinter kbprb kbtshoot KB2790615