LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 24
Default Chart PageSetup Size Speed VBA

Hi folks,

I am completing an Excel VBA project that creates custom chart sizes
from a Library of existing pre-formatted charts by using the Move or
Copy Sheet method from the Library file to the current "datafile" (two
separate files. No problems so far.

I am sizing for PPT and various sizes for Word. Two word sizes require
me to reset the Margins to make the page big enough for me to fit a
ChartArea on it at the correct size (measured in Points that are
translated from Inches). This all works but the following function for
re-sizing slows me down in the following code

Public Function Word_PageSetup_FullPage_Horizontal(wkChart As
Excel.Chart)
'6.75" wide x 7.5" high

'slows down here

With wkChart.PageSetup
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
End With

'speed fine here

wkChart.Activate
With wkChart.ChartArea

.Width = 486
.Height = 540

End With

Is there a faster way to do this? Is the PageSetup a sheetspecific
size or if I reset the PageSetup in the Library file, would that copy
over at the right size with the right margins. Doesn't seem to for me.
Note this code works perfectly and gets me the exactly correct chart
sizes. But takes 3-5 seconds to run just this.

Thanks to all my friends over here.

Brian Reilly, PPT MVP
 
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
Same size chart area over multiple charts niccig Charts and Charting in Excel 0 August 10th 06 10:12 PM
ehhh, is there a way to automatic size the x-axis of a chart Frodo Charts and Charting in Excel 1 April 12th 06 01:28 PM
Urgent Chart Assistance Brent E Charts and Charting in Excel 1 May 10th 05 09:09 AM
Urgent Chart Assistance Requested Brent E Excel Discussion (Misc queries) 0 May 9th 05 11:01 PM
excel chart size using inside positioning Travis Charts and Charting in Excel 2 February 15th 05 04:10 AM


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

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

About Us

"It's about Microsoft Excel"