Excel margin formatting slowed my report run time form a few minutes to over an hour.

downat420

New Member
I added this code after I create my sheet. Where is it most efficient to perform this formatting?

Code:
    chSheet1:PageSetup:LeftMargin = chexcel:Application:InchesToPoints(.25).
    chSheet1:PageSetup:RightMargin = chexcel:application:InchesToPoints(.25).
    chSheet1:PageSetup:TopMargin = chexcel:Application:InchesToPoints(0.5).
    chSheet1:PageSetup:BottomMargin = chexcel:Application:InchesToPoints(0.5).
    chSheet1:PageSetup:HeaderMargin = chexcel:Application:InchesToPoints(0.0).
    chSheet1:PageSetup:FooterMargin = chexcel:Application:InchesToPoints(0.0).
    chSheet1:PageSetup:Zoom = FALSE.
    chSheet1:PageSetup:FitToPagesWide = 1.
    chSheet1:PageSetup:FitToPagesTall = 1.  /* was FALSE */
    chSheet1:PageSetup:ORIENTATION = 2. /* landscape*/
    chSheet1:PageSetup:PrintTitleRows = "$1:$1".


Thank you
 
Re: Excel margin formatting slowed my report run time form a few minutes to over an h

I moved it directly under the creation of the sheet. I noticed I inserted data prior to formatting. Now it runs in a few minutes.

Thank you.
 
Re: Excel margin formatting slowed my report run time form a few minutes to over an h

Hi.

I Had the same problem. I used a sheet with a reduced left margin and every call to excel caused a great use of cpu by the spool manager (curious).
Then, first fill the data then made the format.

MRobles
 
Back
Top