A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

PageSetup macro calls are slow



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2004, 08:58 PM
Stan
external usenet poster
 
Posts: n/a
Default PageSetup macro calls are slow

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
  #2  
Old July 1st, 2004, 01:00 AM
Dave Peterson
external usenet poster
 
Posts: n/a
Default PageSetup macro calls are slow

Here's a thread that addresses the same problem:

http://groups.google.com/groups?thre...GP12.phx. gbl

Two tips are included--only adjust the parms you need to adjust.

Use the John Green version (XLM works faster than VBA in this situation).

(posted by Tom Ogilvy and Ron de Bruin)

Stan wrote:

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


--

Dave Peterson

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro when a font in a range changes whisperinghill General Discussion 0 June 14th, 2004 07:21 PM
Macro command go to last filled cell in column? PatsyB. Setting up and Configuration 1 May 17th, 2004 08:09 PM
word error mac General Discussions 1 May 6th, 2004 08:14 AM
Laptop: PageSetup slow when connected to net Art Du Rea Worksheet Functions 0 April 6th, 2004 06:50 PM
Macro Nicole Worksheet Functions 4 October 9th, 2003 09:53 PM


All times are GMT +1. The time now is 08:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.