Hello All!
Does somebody knows why it takes more processor time when setting some .PageSetup properties?
See example below:
With .Sheets(sSheet).PageSetup
.LeftHeader = "" 'Time consuming
.CenterHeader = "&A" 'Time consuming
.RightHeader = "" 'Time consuming
.LeftFooter = "&F" 'Time consuming
.CenterFooter = "&D" 'Time consuming
.RightFooter = "Page &P" 'Time consuming
.LeftMargin = xlApp.InchesToPoints(0.25) 'Time consuming
.RightMargin = xlApp.InchesToPoints(0.25) 'Time consuming
.TopMargin = xlApp.InchesToPoints(1) 'Time consuming
.BottomMargin = xlApp.InchesToPoints(1) 'Time consuming
.HeaderMargin = xlApp.InchesToPoints(0.5) 'Time consuming
.FooterMargin = xlApp.InchesToPoints(0.5) 'Time consuming
.PrintArea = "" ' Resets or clears PrintArea 'Fast!
.PrintArea = "A1:L" + CStr(lngLastRow) 'Fast!
.Order = xlOverThenDown 'Time consuming
.PrintHeadings = False 'Time consuming
.PrintGridlines = False 'Time consuming
.PrintQuality = 600 'Time consuming
.CenterHorizontally = True 'Time consuming
.CenterVertically = True 'Time consuming
.Orientation = xlLandscape 'Time consuming
.Draft = False 'Time consuming
.PaperSize = xlPaperA4 'Time consuming
.BlackAndWhite = False 'Time consuming
.Zoom = False 'Fast!
.FitToPagesWide = 1 'Fast!
.FitToPagesTall = 1 'Fast!
.PrintErrors = xlPrintErrorsDisplayed 'Fast!
End With
Any idea to speed it up?
Thank you!
Cheerio/TurtleMx
Does somebody knows why it takes more processor time when setting some .PageSetup properties?
See example below:
With .Sheets(sSheet).PageSetup
.LeftHeader = "" 'Time consuming
.CenterHeader = "&A" 'Time consuming
.RightHeader = "" 'Time consuming
.LeftFooter = "&F" 'Time consuming
.CenterFooter = "&D" 'Time consuming
.RightFooter = "Page &P" 'Time consuming
.LeftMargin = xlApp.InchesToPoints(0.25) 'Time consuming
.RightMargin = xlApp.InchesToPoints(0.25) 'Time consuming
.TopMargin = xlApp.InchesToPoints(1) 'Time consuming
.BottomMargin = xlApp.InchesToPoints(1) 'Time consuming
.HeaderMargin = xlApp.InchesToPoints(0.5) 'Time consuming
.FooterMargin = xlApp.InchesToPoints(0.5) 'Time consuming
.PrintArea = "" ' Resets or clears PrintArea 'Fast!
.PrintArea = "A1:L" + CStr(lngLastRow) 'Fast!
.Order = xlOverThenDown 'Time consuming
.PrintHeadings = False 'Time consuming
.PrintGridlines = False 'Time consuming
.PrintQuality = 600 'Time consuming
.CenterHorizontally = True 'Time consuming
.CenterVertically = True 'Time consuming
.Orientation = xlLandscape 'Time consuming
.Draft = False 'Time consuming
.PaperSize = xlPaperA4 'Time consuming
.BlackAndWhite = False 'Time consuming
.Zoom = False 'Fast!
.FitToPagesWide = 1 'Fast!
.FitToPagesTall = 1 'Fast!
.PrintErrors = xlPrintErrorsDisplayed 'Fast!
End With
Any idea to speed it up?
Thank you!
Cheerio/TurtleMx