B
Brian Murphy
Two forms I use for modifying chart formatting that work fine in excel
2003 do not work in excel 2007.
The first is to copy chart formats from one chart to another. This
snippet of code is in an addin, and copies the formatting of a chart
in the addin to a chart in the user's workbook.
ThisWorkbook.Sheets("API
Level1").DrawingObjects(1).Chart.ChartArea.Copy
ActiveSheet.ChartObjects(1).Activate
With ActiveChart
.ChartArea.Select
.Paste Type:=xlFormats
In excel 2003 this simply paste's the formats. But in excel 2007 it
creates new series, and this messes everything up for me. Is there
some trick to pasting just the formats like in excel 2003?
The second problem is editing the text of a data label. I change the
formatting of individual characters with the following code:
With .Points(1).DataLabel
.Text = "QA"
With .Characters(start:=2, Length:=1).Font
.Subscript = True
End With
End With
The above makes the A a subscript in excel 2003, but in excel 2007 it
makes the entire label subscript, that is, both letters become
subscript. I tried it with and without the named arguments. Is there
a way to get this to work in excel 2007?
Thanks,
Brian Murphy
Austin, Texas
2003 do not work in excel 2007.
The first is to copy chart formats from one chart to another. This
snippet of code is in an addin, and copies the formatting of a chart
in the addin to a chart in the user's workbook.
ThisWorkbook.Sheets("API
Level1").DrawingObjects(1).Chart.ChartArea.Copy
ActiveSheet.ChartObjects(1).Activate
With ActiveChart
.ChartArea.Select
.Paste Type:=xlFormats
In excel 2003 this simply paste's the formats. But in excel 2007 it
creates new series, and this messes everything up for me. Is there
some trick to pasting just the formats like in excel 2003?
The second problem is editing the text of a data label. I change the
formatting of individual characters with the following code:
With .Points(1).DataLabel
.Text = "QA"
With .Characters(start:=2, Length:=1).Font
.Subscript = True
End With
End With
The above makes the A a subscript in excel 2003, but in excel 2007 it
makes the entire label subscript, that is, both letters become
subscript. I tried it with and without the named arguments. Is there
a way to get this to work in excel 2007?
Thanks,
Brian Murphy
Austin, Texas