|
|
|
date: Sun, 22 Jun 2008 01:56:00 -0700,
group: microsoft.public.macintosh.general
back
Chart code developed on PC not working on Mac
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
date: Sun, 22 Jun 2008 01:56:00 -0700
author: robs3131
RE: Chart code developed on PC not working on Mac
Forgot to mention -- the error is "Run-time error '1004':Application-defined
or object-defined error"
--
Robert
"robs3131" wrote:
> 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
date: Sun, 22 Jun 2008 13:11:02 -0700
author: robs3131
|
|