Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting,microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Chart creation ceiling in Excel 2002 via Chart.Add ? - SOLUTION

Jon Peltier wrote in message ...
Another approach: don't keep deleting and adding charts. Just reuse one
chart, change its source data range and other particulars and export it,
then repeat as needed.

- Jon


Thanks for the tip Jon! Much cleaner and faster. I did run into the
"too many fonts for this worksheet" bug when using the same chart and
repopulating it, thus I had to add the "AutoScaleFont = False"
statement, and also set AutoScaleFont = False in the separate chart
creation Sub.

Great web site as well.

The codeblock I used is below:

Public Sub GraphExport(TitleId As String, suffix As String, xLabel As
String, expt As String)
''' Select precreated chart, only create once
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
''' Required to avoid too many fonts bug
Selection.AutoScaleFont = False
With ActiveChart
.ChartTitle.Characters.Text = _
expt + " for " + ChartId
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Units"
End With
ActiveChart.HasLegend = False
ActiveChart.SeriesCollection(1).Select
ActiveChart.Axes(xlCategory).Select
Selection.TickLabels.Font.Bold = True
ActiveChart.ChartTitle.Select
Selection.Font.Bold = True
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.Font.Bold = True
With ActiveChart.Parent
.Width = 600
.Height = 300
End With
Selection.TickLabels.Font.Bold = True
''' Export file
Dim FileName As String
FileName = "C:\JUNK\" + suffix + "\" + ProbeId + "_" + suffix +
".gif"
FileName = Replace(FileName, "/", "_")
ActiveChart.Export FileName:=FileName, FilterName:="GIF"
End Sub
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
How do I disable automatic chart creation in Excel? Huang Charts and Charting in Excel 1 November 12th 09 11:02 PM
Excel 2007 Chart creation Lucho Charts and Charting in Excel 1 May 30th 09 02:43 PM
Excel 2007 Chart creation Lucho Charts and Charting in Excel 1 May 29th 09 05:00 PM
chart creation P. Zicari Charts and Charting in Excel 4 October 25th 07 11:16 PM
Excel chart creation biffbowl Excel Discussion (Misc queries) 0 March 17th 06 08:27 PM


All times are GMT +1. The time now is 11:34 PM.

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"