Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2007 ActiveChart formatting erases graph

I'm converting some Excel 2003 macro to 2007. In the charting part, it bombs
because only blank graphs are displayed. After stepping thru it I realize
that the data disappears whenever I do any formatting. Attached is code
snippet. I moved setting the .Values and .XValues at the bottom and seems to
work. What is the general rule? Are we allowed to change the format on the
activeChart after we populate it with data?

Thanks

With ActiveChart
For split_n = 1 To ser_cnt
Set X_rng = Range(chD.Cells(splits(split_n).spR1, chD_c),
chD.Cells(splits(split_n).spR2, chD_c))
Set Y_rng = Range(chD.Cells(splits(split_n).spR1, chD_c + 1),
chD.Cells(splits(split_n).spR2, chD_c + 1))
If Application.Count(Y_rng) 0 Then
ser_n = ser_n + 1
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(ser_n).Values = Y_rng
ActiveChart.SeriesCollection(ser_n).XValues = X_rng
ActiveChart.SeriesCollection(ser_n).Name = splits(split_n).spName
With .SeriesCollection(ser_n)
.MarkerStyle = marker(split_n).mrStyle
.MarkerForegroundColorIndex = marker(split_n).mrForeground
.MarkerBackgroundColorIndex = marker(split_n).mrBackground
.MarkerSize = marker(split_n).mrSize - cht_mrkr
With .Border
.LineStyle = xlContinuous
.ColorIndex = marker(split_n).mrBorderColor
End With
If matrix(4).mxValue = "LIN" Then
.Trendlines.Add Type:=xlLinear
If isEXISTbyOBJ(.Trendlines(1)) = True Then
With .Trendlines(1).Border
.ColorIndex = marker(split_n).mrBorderColor
.Weight = xlHairline
End With
End If
ActiveChart.Legend.LegendEntries(ser_n + 1).Delete
End If
End With
End If
Next
End With
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
Excel 2007 - ActiveChart.Export blurry images. EG18349276 Charts and Charting in Excel 3 August 7th 08 01:16 PM
Graph lines formatting in Excel 2007 Gawayne Charts and Charting in Excel 1 April 7th 08 06:15 PM
MS Excel 2007. ActiveChart.ApplyCustomType Jul Excel Programming 0 January 18th 08 06:56 PM
Hyperlinks.Delete erases cell formatting Glen K Excel Programming 2 December 17th 04 05:55 PM
Argument List Of ActiveChart.Location And ActiveChart.ChartType Mo[_3_] Excel Programming 2 September 1st 03 11:12 PM


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

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"