View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Error 1004 - Unable to set invertifnegative

I set up a chart on a separate sheet and I created a chart on the worksheet
where the data resides using the same data for both charts. Your code ran on
both without throwing an error. Try creating your chart in another workbook
and copy your code over to the new workbook. See if you still get the error.
Also, make sure your code is in the public module and not the sheet module.

"takedownsf" wrote:

Hello,

I am trying to record a macro that I can use with Advent Axys to change the
chart attributes in that program. When I try running the marco, I get a "run
time error 1004 - unable to set the invertifnegative property of the series
class" error message.

Someone on this forum suggested I try putting a (') in front of the code
that was giving me problems but after I did that, I got this error message,
"unable to set the color index property of the interior class."

Can someone please look at my code and tell me what's wrong? Thanks!

Sub imark()
'
' imark Macro
' Macro recorded 5/21/2008 by sandy
'

'
ActiveChart.SeriesCollection(1).Points(1).Select
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
'Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 32
.Pattern = xlSolid
End With
ActiveChart.SeriesCollection(1).ApplyDataLabels AutoText:=True,
LegendKey:= _
False, ShowSeriesName:=False, ShowCategoryName:=False,
ShowValue:=True, _
ShowPercentage:=False, ShowBubbleSize:=False
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 2
.Background = xlTransparent
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Position = xlLabelPositionCenter
.Orientation = xlUpward
End With
Selection.NumberFormat = "$#,##0.00"
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "#,##0"
ActiveChart.ChartTitle.Select
Selection.Characters.Text = "ACCOUNT MARKET VALUES"
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Selection.Font.Bold = True
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
End Sub