PageSetup macro calls are slow

S

Stan

The code below takes nearly 11 seconds to run; this is on a WinXP with
a P4 at 1.2 GHz, 512MB RAM, oceans of free disk space, and Excel 2002.
Experiments with various lines commented out show that each line
requires an astonishing 1.2 seconds to run, except the last three
(.Zoom and the two .FitToPages lines), which execute all but
instantaneously.

Other open programs, available RAM, all the usual suspects for slow
code don't seem to matter here; I get very constant results from
checking the timer before and after this code runs -- even in an empty
workbook with nothing else open.

Any tips on speeding this up?

Thanks!
Stan

With ActiveSheet.PageSetup
'margins are measured in points, 72 points to the inch
.LeftMargin = 36
.RightMargin = 36
.TopMargin = 36
.BottomMargin = 36
.HeaderMargin = 0
.FooterMargin = 0
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

PageSetup calls are slow 3
Printing Macro 6
Worksheet(1).PageSetup 1
Page Setup Macro runs slow 3
Print area - selection 4
PageSetup Performance Question 1
Footer Settings in an Excel Sheet 1
Slow PageSetup macro 3

Top