Hi all,
The line of code preceeded by '***' below is coming up as an error when a
user of mine tries to execute code that was develpoed (and works) on a PC.
Any idea why this line would fail?
'Add the chart in
Sheets("Survey Data Output").Activate
With ActiveSheet.ChartObjects.Add _
(Left:=1, Width:=450, Top:=vartop, Height:=250)
.Chart.SetSourceData Source:=Range(rngchart.Offset(1, 0),
rngchartend)
.Chart.ChartType = xlColumnStacked
.Chart.HasTitle = False
.Chart.Axes(xlCategory, xlPrimary).HasTitle = False
.Chart.Axes(xlValue, xlPrimary).HasTitle = True
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = _
"Number of Occurrences"
.Chart.HasLegend = False
.Chart.HasDataTable = False
With .Chart.SeriesCollection(2).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
With .Chart.ChartArea.Interior
.ColorIndex = 19
.PatternColorIndex = 1
.Pattern = 1
End With
With .Chart.PlotArea.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With .Chart.PlotArea.Interior
.ColorIndex = 36
.PatternColorIndex = 1
.Pattern = xlSolid
End With
With .Chart.SeriesCollection(2).Border
.Weight = xlThin
.LineStyle = xlNone
End With
.Chart.SeriesCollection(2).Shadow = False
.Chart.SeriesCollection(2).InvertIfNegative = False
With .Chart.SeriesCollection(2).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
*** .Chart.SeriesCollection(2).ApplyDataLabels AutoText:=True,
LegendKey:= _
False, ShowSeriesName:=False, ShowCategoryName:=False,
ShowValue:=True, _
ShowPercentage:=False, ShowBubbleSize:=False
With .Chart.SeriesCollection(2).DataLabels
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Position = xlLabelPositionInsideBase
.Orientation = xlHorizontal
End With
End With
--
Robert


|