Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Improve the performance of Excel 2007. | Excel Worksheet Functions | |||
Help Optimizing a Sheet to improve performance | Excel Worksheet Functions | |||
How do I improve the 2007 Excel performance. | Excel Discussion (Misc queries) | |||
how do I improve performance when updating external links? | Excel Discussion (Misc queries) | |||
Advanced Filters - improve performance ? | Excel Programming |