Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default two charting problems with excel 2007

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default two charting problems with excel 2007

Still here then!

.Paste Type:=xlFormats


That works OK for me in 2007, maybe there's something different about your
chart. You could also try -

ActiveSheet.PasteSpecial Format:=2

but only after ensuring the chart is active of course

If even that fails look into these (which is what I do)

AddChartAutoFormat arg's
ApplyCustomType xlUserDefined Typename
DeleteChartAutoFormat arg


In 2007 DataLabels won't accept mixed formats, workaround is to use
textboxes (don't blame me!)

Regards,
Peter T



"Brian Murphy" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default two charting problems with excel 2007


Thank you very much, Peter T.

The PasteSpecial method indeed seems to have solved my problem with
copying chart formats. Hurray!

About character formatting of text in a data label. My addin and the
chart that's in it were created with excel 2003, and the data label
uses a mix of Symbol and Arial fonts and one character is a
subscript. It does display this way in both 2003 and 2007 versions.

In Excel 2007 (12.0 6425) when I manually edit the text in a data
label, excel does let me change the font of individual characters.
But it doesn't seem to allow me to make one be a subscript. However,
I can get a subscript by copying and pasting text from another data
label that does have a subscript.

So in a round about way I can get what I want with manual operations,
but not with VBA statements. I can't even apply formatting to
individual characters in VBA, even though it can be done manually. So
I think I'll give up trying. Darn.

Maybe the chief software architects at Microsoft need help managing
their software.

Brian




On Jun 18, 6:29*am, "Peter T" wrote:
Still here then!

*.Paste Type:=xlFormats


That works OK for me in 2007, maybe there's something different about your
chart. You could also try -

ActiveSheet.PasteSpecial Format:=2

but only after ensuring the chart is active of course

If even that fails look into these (which is what I do)

AddChartAutoFormat arg's
ApplyCustomType xlUserDefined Typename
DeleteChartAutoFormat arg

In 2007 DataLabels won't accept mixed formats, workaround is to use
textboxes (don't blame me!)

Regards,
Peter T

"Brian Murphy" wrote in message

...

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


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
Is this a bug in excel 2007 charting Brian Murphy Excel Programming 9 October 9th 09 02:24 PM
Bug in Excel 2007 SP2 charting Boris Charts and Charting in Excel 0 May 28th 09 02:16 PM
2007 charting problems RLB Charts and Charting in Excel 3 December 26th 08 04:08 PM
Charting in Excel 2007 Charles Eaves New Users to Excel 2 August 4th 08 06:40 PM
Charting in Excel 2007 Aaron Pyle Charts and Charting in Excel 0 April 16th 08 03:39 PM


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

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

About Us

"It's about Microsoft Excel"