Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Run-Time error 1004. Help Please!

Hello,

Can someone please help me? I keep getting the following error message
whenever I try to run a macro I created:

Run-time error '1004':

Unable to set the InvertIfNegative Property of the Series Class

I tried recording a marco with the "invert if negative" box checked and
unchecked but the error message still appears no matter what is checked. Any
help will be appreciated!

Thanks,
Sandy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run-Time error 1004. Help Please!

You should post the code you recorded for best response. Just copy and paste
it to the newsgroup reply form.

"takedownsf" wrote:

Hello,

Can someone please help me? I keep getting the following error message
whenever I try to run a macro I created:

Run-time error '1004':

Unable to set the InvertIfNegative Property of the Series Class

I tried recording a marco with the "invert if negative" box checked and
unchecked but the error message still appears no matter what is checked. Any
help will be appreciated!

Thanks,
Sandy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default Run-Time error 1004. Help Please!

Hi Sandy,

It would help if you showed us the code and which line produced the
error.

It might also be helpful to know more about the data your macro acts
on and which version of Excel you are using.

Thanks,

Dan
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Run-Time error 1004. Help Please!

Thanks for the suggestion. Here's the code. I put a * next to the line that
vb highlights.

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.Axes(xlValue).Select
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels AutoText:=True,
LegendKey:= _
False, ShowSeriesName:=False, ShowCategoryName:=False,
ShowValue:=True, _
ShowPercentage:=False, ShowBubbleSize:=False
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.NumberFormat = "$#,##0.00"
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "#,##0.00"
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.Axes(xlValue).MajorGridlines.Select
ActiveChart.ChartArea.Select
End Sub


"takedownsf" wrote:

Hello,

Can someone please help me? I keep getting the following error message
whenever I try to run a macro I created:

Run-time error '1004':

Unable to set the InvertIfNegative Property of the Series Class

I tried recording a marco with the "invert if negative" box checked and
unchecked but the error message still appears no matter what is checked. Any
help will be appreciated!

Thanks,
Sandy

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run-Time error 1004. Help Please!

I am guessing that you don't need that line in the code. To test my theory,
put an apostrophe ( ' ) ,without the parentheses, in front of that line.
That will make it a comment and VBA will ignore it when the code runs. Then
see if the macro will do what you want.

Some of these properties that respond to boolean true/false will throw an
error if there is nothing for it to evaluate. I don't work with charts using
VBA hardly ever, so I am really taking a stab at this one. If my suggestion
doesn't do the job, then make a new posting with the code and the explanation
you gave about the error message. Someone smarter than me will help you out.

"takedownsf" wrote:

Thanks for the suggestion. Here's the code. I put a * next to the line that
vb highlights.

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.Axes(xlValue).Select
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels AutoText:=True,
LegendKey:= _
False, ShowSeriesName:=False, ShowCategoryName:=False,
ShowValue:=True, _
ShowPercentage:=False, ShowBubbleSize:=False
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.NumberFormat = "$#,##0.00"
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "#,##0.00"
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.Axes(xlValue).MajorGridlines.Select
ActiveChart.ChartArea.Select
End Sub


"takedownsf" wrote:

Hello,

Can someone please help me? I keep getting the following error message
whenever I try to run a macro I created:

Run-time error '1004':

Unable to set the InvertIfNegative Property of the Series Class

I tried recording a marco with the "invert if negative" box checked and
unchecked but the error message still appears no matter what is checked. Any
help will be appreciated!

Thanks,
Sandy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Run Time Error 1004: Application or Object Defined Error BEEJAY Excel Programming 4 October 18th 06 04:19 PM
Run Time 1004 Error: Application or Object Difine Error BEEJAY Excel Programming 0 October 17th 06 10:45 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Application Run Time Error 1004 and Stack Error ExcelMonkey[_190_] Excel Programming 9 February 11th 05 04:48 PM


All times are GMT +1. The time now is 01:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"