View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default .SeriesCollection(2).Name and .Deselect

Does the code work in Excel 2003? Then you should assume that by the time
the Beta has been tested and fixed up, that the code will work in Excel
2007. You do know that's what a Beta is for, right?

I'm not sure what I'm allowed to say about specifics, but the Excel team is
trying to maintain backwards compatibility, and .Characters is one of the
things that I believe they will fix before RTM. Some of the code dealing
with chart data is a bit flaky too.

PS. Why are you using + instead of & for concatenation?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Peter Sie" <Peter wrote in message
...
I have more than 10,000 lines of VBA code in one aplication. When kicked
off
initially I received the following message during open of my application:

"Prop bitmap DLL not loaded". What can I do to overcome this problem or is
there a fix for it?

Using a second ".Name" or a second ".XValues" command in Excel for
charting
creates a dump which I replied yes to submit to MS. This error totally
destroys Excel's code checking feature (simple .LineType commands will
prior
to this abnormal end be processed ok, however, after this abnormal end it
is
being flagged as an invalid command). I had to repair Office 2007 in order
to
restore my Office 2007 environment.

Here is an example of my code which fails:

With ActiveChart
.Select
.SetSourceData Source:=Sheets("Life").Range("B1:C" & Max_Year + 2),
PlotBy:=xlColumns
.HasTitle = True
.ChartTitle.Text = "Life length calculated from data on the DataBase
Sheet. " + Scope + " scope." + vbCr + "Graph produced: " + Str(Now()) +
"."
.SeriesCollection(1).Name = "Number of deaths at a particular age."
' Office 2007 bug .SeriesCollection(2).Name = "Average 5 Trendline"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Text = "Age when dying for" +
Str(ii - 3) + " family members."
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Text = "Frequency of deaths"
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
.SeriesCollection(1).XValues = "=Life!R1C1:R" & Max_Year + 2 & "C1"
' Office 2007 bug .SeriesCollection(2).XValues = "=Life!R1C1:R" &
Max_Year + 2 & "C1"
'.Deselect
End With

The ".Deselect" command is no longer allowed.

".Characters" is no longer supported either, it has to be left out in
Office
2007, example:
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Age distribution."
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "All
persons."
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Age in
years."
End With

Cheers,
Peter Sie.