Error 1004 - Unable to set invertifnegative

T

takedownsf

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
 
J

JLGWhiz

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.
 
T

takedownsf

I have no idea how to do what you suggested. I guess maybe the problem is
with Advent Axys and not the macro? Thanks for helping me. I really
appreciate it!
 
A

Andy Pope

Hi,

Silly question but is the active chart you are trying to run the code on
a column or bar chart?

Cheers
Andy
 
T

takedownsf

OMG! Thank you so much Andy! You're question made me realize I wasn't running
the chart in the correct settings in Advent. It's working now! And thank you
JLGWhiz for being patient with me and helping me get rid of the
"invertifnegative" problem. You two rock!
 
A

Andy Pope

What is this Advent Axys? Are you trying to run the VBA code on
something other than an excel chart?

Cheers
Andy
 
J

JLGWhiz

Glad you got it cleared up. Sometimes all it takes is another set of eyes,
or a different line of logic.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Macro Error 1
Floating Bar Chart 1004 error 0
Change code help 0
change in the formatting of data series 2
Autofill Error 4
Excel hangs 1
Page Setup not working in macro 1
How to rewrite this code? (first half) 1

Top