So I have a block of code that is supposed to make a table, format it a bit, then add a whole bunch of series to it. Everything worked fine until I added the stuff under the " 'Lining up Plot Areas" section.
Sorry, I feel like you can probably ignore most of that but you never know. Maybe someone will see something else I need to fix anyway (being new is so much fun...can't wait until I'm no longer clueless.)
The error is:
Which seems self explanatory, but try as I might I cannot figure out what I am doing wrong with .width. I don't think it's the way I'm calling .PlotArea because the line
works just fine, and has for a while. But the first of the new lines I added in breaks everything.
Any ideas? Thanks in advance...
PS - Noticed I had the formatting before the actual creation of the plot area. So I moved it to after the creation of the plot area. No help, still broken. Will continue trying...
</problem>
Code:
With infoGraph.Chart
.ChartType = xlColumnClustered
.ChartStyle = 42
'Lining up Plot Areas
.PlotArea.Format.Fill.Transparency = 1
.PlotArea.Width = 25 'PROBLEM HERE
.PlotArea.Left = 30
.PlotArea.Top = 30
.PlotArea.Width = 400
Do Until .SeriesCollection.Count = 0
.SeriesCollection(1).Delete
Loop
For j = 1 To SeriesCount 'jCount To jUpperBound
For i = 1 To 9
'This makes you skip every 3rd one
If (i Mod 3 <> 0) Then
Set newSeries = .SeriesCollection.newSeries
With newSeries
.Values = ActiveSheet.Range(GraphData(i, j))
If (i = 1 Or i = 2) Then
nameString = "2010"
ElseIf (i = 4 Or i = 5) Then
nameString = "2011"
Else
nameString = "2012"
End If
nameString = nameString & " " & GraphData(10, j) & " "
If (i = 1 Or i = 4 Or i = 7) Then
nameString = nameString & "O'Reilly Vol"
Else
nameString = nameString & "Market Vol"
End If
.Name = nameString
End With
End If
Next i
Next j
End With
<problem line
Sorry, I feel like you can probably ignore most of that but you never know. Maybe someone will see something else I need to fix anyway (being new is so much fun...can't wait until I'm no longer clueless.)
The error is:
Code:
Run-time error '-2147467259 (80004005)'
Method 'Width' of object 'PlotArea' failed
Which seems self explanatory, but try as I might I cannot figure out what I am doing wrong with .width. I don't think it's the way I'm calling .PlotArea because the line
Code:
.PlotArea.Format.Fill.Transparency = 1
works just fine, and has for a while. But the first of the new lines I added in breaks everything.
Any ideas? Thanks in advance...
PS - Noticed I had the formatting before the actual creation of the plot area. So I moved it to after the creation of the plot area. No help, still broken. Will continue trying...
</problem>
Last edited: