Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
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! "JLGWhiz" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
Hi,
Silly question but is the active chart you are trying to run the code on a column or bar chart? Cheers Andy 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 -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
columns
"Andy Pope" wrote: Hi, Silly question but is the active chart you are trying to run the code on a column or bar chart? Cheers Andy 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 -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
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! "Andy Pope" wrote: Hi, Silly question but is the active chart you are trying to run the code on a column or bar chart? Cheers Andy 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 -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
What is this Advent Axys? Are you trying to run the VBA code on
something other than an excel chart? Cheers Andy takedownsf wrote: columns "Andy Pope" wrote: Hi, Silly question but is the active chart you are trying to run the code on a column or bar chart? Cheers Andy 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 -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 - Unable to set invertifnegative
Glad you got it cleared up. Sometimes all it takes is another set of eyes,
or a different line of logic. "takedownsf" wrote: 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! "Andy Pope" wrote: Hi, Silly question but is the active chart you are trying to run the code on a column or bar chart? Cheers Andy 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 -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime Error 1004 Unable to set the top property of the picture c | Excel Discussion (Misc queries) | |||
Error 1004: Unable to get the axis property | Charts and Charting in Excel | |||
Run Time Error 1004 Unable to set hidden property | Excel Programming | |||
Run-time Error '1004' Unable to get the findnext property... | Excel Programming | |||
Error 1004: Unable to set the XValues of the Series Class | Excel Programming |