Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
mac
excel.macintosh
frontpage.mac
inetexplorer.mac
internet.mail.mac
internet.news.mac
mac.entourage
mac.excel
mac.explorer
mac.mediaplayer
mac.messenger
mac.office
mac.otherproducts
mac.powerpoint
mac.rdc
mac.virtualpc
mac.word
macintosh.general
media.player.mac
messenger.mac
office.mac
office.mac.entourage
outlook.mac
outlookexpress.mac
win2000.macintosh
windowsnt.mac
word.macword2001
  
 
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

Re: Chart code developed on PC not working on Mac   
You also forgot to mention *where* the user is trying to run the code:-)
Without any indication of OS , application & specific versions of each it's
pretty hard to tell what the problem may be.

If it is Excel & it is Mac you'd do best to post directly to that group:

Microsoft.public.mac.office.excel

If it's a PC version of Excel you'll find the WinOffice groups here:

http://www.microsoft.com/office/community/en-us/FlyoutOverview.mspx

Good Luck |:>)
Bob Jones 
[MVP] Office:Mac



On 6/22/08 4:11 PM, in article
9C12CEEA-D2BA-43F7-9FB2-2C305956A945@microsoft.com, "robs3131"
 wrote:

> Forgot to mention -- the error is "Run-time error '1004':Application-defined
> or object-defined error"
date: Sat, 05 Jul 2008 16:39:13 -0400   author:   CyberTaz

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us