Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default PageSetup is very slow

"Howard Kaikow" wrote in message
...
In Excel 2003, on an old computer, the PageSetUp stuff (code below) takes
6-7 seconds in a visible Excel VBA IDE.
Using VB6 to automate Excel, corresponding code takes 9 seconds.

Commenting out the .Order = xlDownThenOver saves about 1 second.
Commenting out the .FirstPageNumber = xlAutomatic seems to have no impact,
likely because it is the default.

Does not seem to be any way to speed things up.

Sub TestPageSetup()
Dim d As Double
Dim d1 As Double

Application.ScreenUpdating = False

With ActiveSheet
Debug.Print Application.ScreenUpdating
Debug.Print Now
''''''''''''''''''''''''''''''''''''''''
With .PageSetup
.Orientation = xlLandscape
With .Application
d = .InchesToPoints(0.5)
d1 = .InchesToPoints(0.75)
End With
.LeftMargin = d
.RightMargin = d
.TopMargin = d1
.BottomMargin = d1
.HeaderMargin = d
.FooterMargin = d
.LeftHeader = "&F"
.CenterHeader = "&A"
.RightHeader = ""
.LeftFooter = "&D(&T)"
.CenterFooter = ""
.RightFooter = "Page &P of &N"
.PrintGridlines = True
' .FirstPageNumber = xlAutomatic
' .Order = xlDownThenOver
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
''''''''''''''''''''''''''''''''''''''''
Debug.Print Now
End With
Debug.Print Application.ScreenUpdating
Application.ScreenUpdating = True
End Sub



I'm baaaack!

previously, my main system was a Windoze 2000 Pentium II 400 with 768MB of
memory and three 7200 rpm SCSI hard drives.

As you may recall, from this, and other threads, I pointed out that
PageSetup was very slow , and the best that I could do was to split the
burden out of the Load event and display a splash screen at an appropriate
time. Typically, the PageSetup stuff took 8-9 seconds to run on the PII.

I put in a more accurate timer and the last time I ran on the PII, the time
was 8516 milliseconds.
At end of May, I purchased a Vista notebook with 4GB of memory, a 5400rpm
drive, and a 21.GHz Intel Centrino processor using Intel Core 2 Duo
Processor T8100.

I needed that to use Office 2007, and I figured that it would beat the crap
out of the PII speedwise.

Well, I finally got around to installing Office Ultimate 2007 today.

The Pagesetup stuff used 6085 milliseconds on a computer that is several
times faster than a PII 400. Rather disappointing!

I am using a .exe that was compiled with VB 6 and Excel 2003.
Maybe would be faster if I compiled with Excel 2007 and VB 6?
If so, then I may need to have a separate .exe for use with Excel 2007, not
a desired goal,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default PageSetup is very slow

"Howard Kaikow" wrote in message
...

I am using a .exe that was compiled with VB 6 and Excel 2003.
Maybe would be faster if I compiled with Excel 2007 and VB 6?
If so, then I may need to have a separate .exe for use with Excel 2007,

not
a desired goal,


Recompiling in Vista with VB 6 and Excel 2007 indeed makes a difference.

Using the Vista compile with VB 6 and Excel 2007, it took 868 milliseconds
to load Excel 2007, and 3134 milliseconds to do the Pagesetup stuff.

Using that same .exe, but running in Windows 2000 with Excel 2003, it took
3134 milliseconds to load Excel 2003, and 7731 milliseconds to do the
Pagesetup stuff.

since early binding is used, I was surprised that the Excel 2007 .exe even
worked in Excel 2003
Is this documented, or was I just lucky?


Reply
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
PageSetup is very slow Howard Kaikow Excel Programming 2 May 17th 08 05:57 PM
Why is this PageSetup Macro So Slow? [email protected] Excel Discussion (Misc queries) 6 July 19th 05 09:28 PM
PageSetup calls are slow Stan Excel Programming 3 July 1st 04 05:03 PM
PageSetup is slow Christof DB Excel Programming 4 December 5th 03 04:09 PM
PageSetup slow Oliver Chiu Excel Programming 1 July 10th 03 02:06 PM


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

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

About Us

"It's about Microsoft Excel"