R
Ronald
Hi.
From Access I open Excel, export data to a sheet and then create a chart. It
works well, but now I want to make the chart graphics lines thinner.
The code I use to create the chart and graphics lines is shown below.
As you can see I (try to) use
..Chart.SeriesCollection(intField).LineFormat.Weight = 1
and
..Chart.SeriesCollection(intField).Shape.Line.Weight = 1
to set the width of the line(s), but both give me a 'property or method not
supported' (error 438) error.
I've tried lots of things but I think one of these lines of code must be
close to the answer.
Can anybody help me, please?
Thanks!
Ronald.
This is my code:
.Shapes.AddChart.Select
Set exlChart = .ChartObjects(1)
With [exlChart]
.Chart.SeriesCollection(1).Delete
.Chart.ChartType = xlLineMarkers
If (UBound(varTabel, 2) = 0) Then
'1 data rij
.Chart.Axes(xlCategory).AxisBetweenCategories = True
For intField = 1 To UBound(varTabel, 1)
.Chart.SeriesCollection.NewSeries
.Chart.SeriesCollection(intField).Name = "=Blad1!$" & Chr(65 +
intField) & "$3"
.Chart.SeriesCollection(intField).Values = "=Blad1!$" & Chr(65
+ intField) & "$4"
.Chart.SeriesCollection(intField).XValues = "=Blad1!$A$4"
' .Chart.SeriesCollection(intField).LineFormat.Weight = 1
Next intField
Else
'meerdere data rijen
.Chart.Axes(xlCategory).AxisBetweenCategories = False
For intField = 1 To UBound(varTabel, 1)
.Chart.SeriesCollection.NewSeries
.Chart.SeriesCollection(intField).Name = "=Blad1!$" & Chr(65 +
intField) & "$3"
.Chart.SeriesCollection(intField).Values = "=Blad1!$" & Chr(65
+ intField) & "$4:" & Chr(65 + intField) & CStr(UBound(varTabel, 2) + 4)
.Chart.SeriesCollection(intField).XValues = "=Blad1!$A$4:A" &
CStr(UBound(varTabel, 2) + 4)
' .Chart.SeriesCollection(intField).Shape.Line.Weight = 1
Next intField
End If
From Access I open Excel, export data to a sheet and then create a chart. It
works well, but now I want to make the chart graphics lines thinner.
The code I use to create the chart and graphics lines is shown below.
As you can see I (try to) use
..Chart.SeriesCollection(intField).LineFormat.Weight = 1
and
..Chart.SeriesCollection(intField).Shape.Line.Weight = 1
to set the width of the line(s), but both give me a 'property or method not
supported' (error 438) error.
I've tried lots of things but I think one of these lines of code must be
close to the answer.
Can anybody help me, please?
Thanks!
Ronald.
This is my code:
.Shapes.AddChart.Select
Set exlChart = .ChartObjects(1)
With [exlChart]
.Chart.SeriesCollection(1).Delete
.Chart.ChartType = xlLineMarkers
If (UBound(varTabel, 2) = 0) Then
'1 data rij
.Chart.Axes(xlCategory).AxisBetweenCategories = True
For intField = 1 To UBound(varTabel, 1)
.Chart.SeriesCollection.NewSeries
.Chart.SeriesCollection(intField).Name = "=Blad1!$" & Chr(65 +
intField) & "$3"
.Chart.SeriesCollection(intField).Values = "=Blad1!$" & Chr(65
+ intField) & "$4"
.Chart.SeriesCollection(intField).XValues = "=Blad1!$A$4"
' .Chart.SeriesCollection(intField).LineFormat.Weight = 1
Next intField
Else
'meerdere data rijen
.Chart.Axes(xlCategory).AxisBetweenCategories = False
For intField = 1 To UBound(varTabel, 1)
.Chart.SeriesCollection.NewSeries
.Chart.SeriesCollection(intField).Name = "=Blad1!$" & Chr(65 +
intField) & "$3"
.Chart.SeriesCollection(intField).Values = "=Blad1!$" & Chr(65
+ intField) & "$4:" & Chr(65 + intField) & CStr(UBound(varTabel, 2) + 4)
.Chart.SeriesCollection(intField).XValues = "=Blad1!$A$4:A" &
CStr(UBound(varTabel, 2) + 4)
' .Chart.SeriesCollection(intField).Shape.Line.Weight = 1
Next intField
End If