Invalid Parameter Error Vba
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies vba add data series to chart of this site About Us Learn more about Stack Overflow the company Business excel vba chart seriescollection Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask seriescollection vba Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error '1004' “Invalid Parameter” when defining data series up vote 0 down vote favorite I've written some code that will assign data series' to copied charts. The first 5 data series assignments work out, but the 6th one triggers an error for some reason. The error states: "Run-time error '1004' Invalid Parameter" This is the line causing the problem: ActiveChart.SeriesCollection(6).Values = ActiveSheet.Range("G" & Z - 15 & ":G" & Z - 5) This is the full code: Sub Macro1() ' ' Macro1 Macro ' ' Dim x As Long x = ActiveSheet.ChartObjects.Count y = ActiveSheet.UsedRange.Rows.Count Rows("2144:2163").Select Selection.Copy Application.CutCopyMode = False Selection.Copy Rows(1 + y).EntireRow.Select ActiveSheet.Paste ActiveSheet.ChartObjects(x + 2).Activate Z = ActiveSheet.UsedRange.Rows.Count ActiveChart.SeriesCollection(1).Values = ActiveSheet.Range("B" & Z - 15 & ":B" & Z - 5) ActiveChart.SeriesCollection(2).Values = ActiveSheet.Range("C" & Z - 15 & ":C" & Z - 5) ActiveChart.SeriesCollection(3).Values = ActiveSheet.Range("D" & Z - 15 & ":D" & Z - 5) ActiveChart.SeriesCollection(4).Values = ActiveSheet.Range("E" & Z - 15 & ":E" & Z - 5) ActiveChart.SeriesCollection(5).Values = ActiveSheet.Range("F" & Z - 15 & ":F" & Z - 5) ActiveChart.SeriesCollection(6).Values = ActiveSheet.Range("G" & Z - 15 & ":G" & Z - 5) ActiveSheet.ChartObjects(x + 3).Activate ActiveChart.SeriesCollection(1).Values = ActiveSheet.Range("W" & Z - 15 & ":W" & Z - 5) ActiveChart.SeriesCollection(2).Values = ActiveSheet.Range("X" & Z - 15 & ":X" & Z - 5) ActiveChart.SeriesCollection(3).Values = ActiveSheet.Range("Y" & Z - 15 & ":Y" & Z - 5) ActiveChart.SeriesCollection(4).Values = ActiveSheet.Range("Z" & Z - 15 & ":Z" & Z - 5) ActiveChart.SeriesCollection(5).Values = ActiveSheet.Ra
Forums Excel Questions Run Time Error 1004 : Invalid Parameter Results 1 to 3 of 3 Run Time Error 1004 : Invalid ParameterThis is a discussion on Run Time Error 1004 : Invalid Parameter within the Excel Questions forums, part of the Question Forums category; Does anyone know why I'm getting this error message. Sheets(" Pr GRAPHs").Select ActiveSheet.ChartObjects("Chart 2").Activate If Range("H1") = "West Midlands" Then ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Aug 29th, 2007,10:36 AM #1 poolf01 Board Regular Join Date Apr 2007 Posts 212 Run Time Error 1004 : Invalid Parameter http://stackoverflow.com/questions/18323436/error-1004-invalid-parameter-when-defining-data-series Does anyone know why I'm getting this error message. Sheets("Pr GRAPHs").Select ActiveSheet.ChartObjects("Chart 2").Activate If Range("H1") = "West Midlands" Then With ActiveChart.SeriesCollection(7) .Name = "WM KPI" .Values = Sheets("KPIs").Range("R59:U59") .ChartType = xlLine End With End If This code was working earlier, but now I'm getting an error message Thanks Share Share this post on Digg Del.icio.us Technorati Twitter Faye International Synergies Limited Reply With Quote Aug 29th, 2007,10:45 AM #2 Joe4 MrExcel MVPModerator Join Date Aug 2002 Posts 34,764 Did you http://www.mrexcel.com/forum/excel-questions/278469-run-time-error-1004-invalid-parameter.html change the names of any of the Sheets or Charts? If you step through the code line-by-line with the F8 key, which line is causing the error? Share Share this post on Digg Del.icio.us Technorati Twitter TIPS FOR FINDING EXCEL SOLUTIONS 1. Use the built-in Help that comes with Excel/Access 2. Use the Search functionality on this board 3. A lot of VBA code can be acquired by using the Macro Recorder. "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!" Reply With Quote Aug 29th, 2007,10:49 AM #3 poolf01 Board Regular Join Date Apr 2007 Posts 212 D'oh! Apologies I am sooooo stupid. I actually removed the 7th series and so I guess the macro didn't know what to reference! Have sorted it now - thanks anyway Share Share this post on Digg Del.icio.us Technorati Twitter Faye International Synergies Limited Reply With Quote « Previous Thread | Next Thread » Like this thread? Share it with others Like this thread? Share it with others Twitter Linked In Google Reddit StumbleUpon Posting Permissions You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On [VIDEO] code is Off HTML code is On Trackbacks are On Pingbacks are On Refbacks are On Forum Rul
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel https://msdn.microsoft.com/en-us/library/aa445484(v=vs.60).aspx 9 Documentation APIs and reference Dev centers Samples Retired content We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Reference Trappable http://www.excelforum.com/showthread.php?t=806652 Errors Core Visual Basic Language Errors Core Visual Basic Language Errors 5 Invalid procedure call or argument 5 Invalid procedure call or argument 5 Invalid procedure call or argument invalid parameter 3 Return without GoSub 5 Invalid procedure call or argument 6 Overflow 7 Out of memory 9 Subscript out of range 10 This array is fixed or temporarily locked 11 Division by zero 13 Type mismatch 14 Out of string space 16 Expression too complex 17 Can't perform requested operation 18 User interrupt occurred 20 Resume without invalid parameter error error 28 Out of stack space 35 Sub, Function, or Property not defined 47 Too many DLL application clients 48 Error in loading DLL 49 Bad DLL calling convention 51 Internal error 52 Bad file name or number 53 Can't find specified file 54 Bad file mode 55 File already open 57 Device I\O error 58 File already exists 59 Bad record length 61 Disk full 62 Input past end of file 63 Bad record number 67 Too many files 68 Device unavailable 70 Permission denied 71 Disk not ready 74 Can't rename with different drive 75 Path\File access error 76 Path not found 91 Object variable or With block variable not set 92 For loop not initialized 93 Invalid pattern string 94 Invalid use of Null 96 Can't sink this object's events because it's already firing events... 97 Can't call Friend procedure on an object that isn't an instance of... 98 A property or method call cannot include a reference to a private ... 321 Invalid file for
Forum Microsoft Office Application Help - Excel Help forum Excel Programming / VBA / Macros Error "Invalid Parameter" in Charting VBA Code To get replies by our experts at nominal charges, follow this link to buy points and post your thread in our Commercial Services forum! Here is the FAQ for this forum. + Reply to Thread Results 1 to 2 of 2 Error "Invalid Parameter" in Charting VBA Code Thread Tools Show Printable Version Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 12-21-2011,01:13 PM #1 JieJenn View Profile View Forum Posts Visit Homepage Forum Expert Join Date 12-14-2009 Location San Francisco, CA MS-Off Ver 2010 & 2013 Posts 2,798 Error "Invalid Parameter" in Charting VBA Code Been trying to figure out what the reason caused the "Invalid Parameter" error for the past 20 minutes... and still clueless. Anyway, In my worksheet I have 2 charts. In my VBA code, I defined both chart with individual seriescollection (SeriesCollection(1) for chart one and SeriesCollect(2) for chart two). However, I kept getting the Invalid Parameter at line ChtObjTELCO.Chart.SeriesCollection(2).Values = Range(Cells(UserRow, 8), Cells(UserRow, 9)) and to be honest, I can't figure it out why. Any help is appreciated. Below is my code and I have attached a sample workbook Please Login or Register to view this content. Last edited by JieJenn; 12-21-2011 at 01:37 PM. To thank someone who has helped you, click on the star icon below their name. I hate reading Guess I am no longer young after turning 30... Register To Reply 12-21-2011,01:34 PM #2 JieJenn View Profile View Forum Posts Visit Homepage Forum Expert Join Date 12-14-2009 Location San Francisco, CA MS-Off Ver 2010 & 2013 Posts 2,798 Re: Kept Gettint Error "Invalid Parameter" in my Charting VBA Code Never mind.