LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default PageBreak problem. How to improve performance?

Dear,

I have a program that makes a report and add some pagebreaks. The
following code processed 21 records, and added 18 pagebreaks.

dim xlWorksheet As Excel.Worksheet
Dim intCounter As Integer
Dim intBreakGroupCounter As Integer

.......

With xlWorksheet
For i = 0 To lngRecordCnt - 1

......

If gintPageBreak 0 Then
If intCounter intBreakGroupCounter And (intCounter Mod
gintPageBreak) = 0 Then
.HPageBreaks.Add (.Cells(intCounter), 1)) <----
intBreakGroupCounter = intCounter
End If
End If
Next i
End With

1. When I set the default printer to the printer that was not ready,
the program took 28 seconds.
2. When I set the default printer to the printer that was ready, such
as Microsoft Office Document Image Writer, the program took 12 seconds.
3. When I deleted or remarked the pagebreak code line, it took 1
second.
' .HPageBreaks.Add (.Cells(intCounter), 1))

How can I improve the performance when I add some pagebreaks.


Liu Jianzhong

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Improve the performance of Excel 2007. Heera Excel Worksheet Functions 1 October 23rd 08 03:14 AM
Help Optimizing a Sheet to improve performance Vulcan Excel Worksheet Functions 2 June 14th 08 02:56 AM
How do I improve the 2007 Excel performance. Pete Excel Discussion (Misc queries) 1 April 26th 08 06:43 PM
how do I improve performance when updating external links? Using formulas to enter NULL cell values Excel Discussion (Misc queries) 2 April 6th 06 02:48 PM
Advanced Filters - improve performance ? IrelandA Excel Programming 1 August 26th 03 05:41 PM


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"