when I create a chart for the first time,

G

greg

when I create a chart for the first time,
I cannot get to any of the
Chart.SeriesCollection(1).ErrorBars.Border properties.
They all come up "unable to get XXX property of the border class"
then next time I draw a chart, everything is fine.
I even tried the following before trying to set these properties:
Excel.ActiveWorkbook.RefreshAll
ActiveSheet.ChartObjects(1).Chart.Refresh
Calculate
but still cannot see the chart border properties.

Anyone have any ideas?

thanks
 
R

ryguy7272

Try using a ject. Dim to declare a ChartObject. Practice by recording a
macro when building your chart! Then, copy/paste the code that you get into
your macro. It will be something like this:

Sub BuildBigChart()
ActiveSheet.ChartObjects.Delete
Dim myChtObj As ChartObject

Set myChtObj = ActiveSheet.ChartObjects.Add _
(Left:=500, Width:=800, Top:=50, Height:=1500)

myChtObj.Chart.SetSourceData
Source:=Sheets("Sheet1").Range("BeginNamedRange:EndNamedRange")
myChtObj.Chart.ChartType = xlBarClustered

Dim RngToCover As Range
'Do all the formatting and stuff here…

End Sub

HTH,
Ryan---
 
G

greg

it does seem like I am creating the chart correctly.
even looking at the properties the haserrorbars = true
just the first time creating the properties for error bars are
unable to get XXX property of the border class

but second time i create a char, its fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top