C
cctrader2000
The following typical code will crash Excel 2007 SP2 if the active sheet has
a large amount of data (I have in excess of 300 cols and 1000 rows)
Dim chObj as ChartObject
Set chObj = ActiveSheet.ChartObjects.Add(xLeft, xTop, xWidth, xHeight)
To solve the problem select a subset of the active sheet prior to creating
the chart.
ActiveSheet.Range("A1:A2").Select
Set chObj = ActiveSheet.ChartObjects.Add(xLeft, xTop, xWidth, xHeight)
This seems to produce a clean chart without any data series which can be
added later.
The other typical code for creating a chart with shapes has the same problem:
Dim MyChart as Chart
Set myChart = ActiveSheet.Shapes.AddChart(xLeft, xTop, xWidth, xHeight).Chart
and is corrected the same way
ActiveSheet.Range("A1:A2").Select
Set myChart = ActiveSheet.Shapes.AddChart(xLeft, xTop, xWidth, xHeight).Chart
myChart.SeriesCollection(1).Delete
Unfortunately, this method plots the selected data. The
SeriesCollection(1).Delete cleans the chart that is now ready to have the
data series added programmatically.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...6ad9cab4a4&dg=microsoft.public.excel.charting
a large amount of data (I have in excess of 300 cols and 1000 rows)
Dim chObj as ChartObject
Set chObj = ActiveSheet.ChartObjects.Add(xLeft, xTop, xWidth, xHeight)
To solve the problem select a subset of the active sheet prior to creating
the chart.
ActiveSheet.Range("A1:A2").Select
Set chObj = ActiveSheet.ChartObjects.Add(xLeft, xTop, xWidth, xHeight)
This seems to produce a clean chart without any data series which can be
added later.
The other typical code for creating a chart with shapes has the same problem:
Dim MyChart as Chart
Set myChart = ActiveSheet.Shapes.AddChart(xLeft, xTop, xWidth, xHeight).Chart
and is corrected the same way
ActiveSheet.Range("A1:A2").Select
Set myChart = ActiveSheet.Shapes.AddChart(xLeft, xTop, xWidth, xHeight).Chart
myChart.SeriesCollection(1).Delete
Unfortunately, this method plots the selected data. The
SeriesCollection(1).Delete cleans the chart that is now ready to have the
data series added programmatically.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...6ad9cab4a4&dg=microsoft.public.excel.charting