Article ID: 199505 - Last Review: January 23, 2007 - Revision: 5.1 Macro performance slow when page breaks are visible in Excel
This article was previously published under Q199505
For a Microsoft Excel 97 version of this article, see 145598
(http://support.microsoft.com/kb/145598/
)
.
On This PageSYMPTOMS When you run a Microsoft Visual Basic for Applications
(VBA) macro in a later version of Microsoft Excel, the macro may take longer to complete than it does in
earlier versions of Excel. For example, a macro that required several seconds
to complete in an earlier version of Excel may require several minutes to
complete in a later version of Excel. Alternatively, if you run a macro a second time, the macro may take twice as long to run as it did the first time. CAUSE This problem may occur if the following conditions are
true:
When you set a PageSetup property, automatic calculation of page breaks is enabled in Excel. By default, this property is not set. WORKAROUND To work around this issue, use either of the following
methods. Method 1: Manually disable the page breaks displayTo do this in Excel 2003 and in earlier versions of Excel, follow these steps:
Method 2: Disable the page breaks display programmaticallyMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.To disable the page breaks display programmatically, add the following line of code to your VBA macro. | Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top