HOWTO: How to prevent screen flicker during macros

Reference: Q0048

Article last modified on 15-Feb-2008


The information in this article applies to:

  • XLL+ for Visual Studio .NET - 3, 4.1, 4.2, 4.3.1, 5.0
  • XLL+ for Visual Studio 6 - 3, 4.1, 4.2, 4.3.1, 5.0
  • XLL+ for Visual Studio 2005 - 5.0

How to prevent screen flicker during macros

Issue

I have a macro which makes a lot of changes to a workbook. How can I prevent the screen flickering while these changes are made?

Solution

To stop the flickering, you can stop the screen refreshing until you have finished updating cells:

CXlMacros::Echo(0);
// Update cells...
CXlMacros::Echo(1);