+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    02-02-2005
    Location
    London, England
    MS-Off Ver
    Office 2003
    Posts
    11

    Setting Series Values In VBA

    Good morning everyone,

    I am in the middle of building a new navigation portal for my stakeholders and have some charts that update based upon the selection from a drop down list on the worksheet. The problem i have is that it keeps randomly falling over for no aparrent reason. The message i get is "Unable to set the values property of the series class". This has happened at various times at different points in the code. Currently my development version works fine but my testing version is falling over. Below is a section of the code i run as an update macro on the drop down list. The original code i wrote was much more streamlined but as it keeps falling over ive changed it to get it working.

    One other point to mention is that it only ever fails when updating the 2nd data series.

    Any help would be greatly appreciated.

    Thanks

    EddiesVoicebox

    Code:
    Private Sub cmboMetric_Change()
        Dim ActColRef, FCColRef As Integer
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ActiveSheet.Shapes("Picture 506").Visible = True
    
    If Range("AL4").Value = "Total Calls" Then
                                                            ActColRef = "2"
                                                            FCColRef = "3"
    'CAR CHART
                                                            ActiveSheet.ChartObjects("Chart 498").Activate
                                                            ActiveChart.PlotArea.Select
                                                            ActiveChart.SeriesCollection(1).Values = "=dataPRVCAR!R6C" & ActColRef & ": R58C" & ActColRef
        If Range("X4").Value = "0+12" Then ActiveChart.SeriesCollection(2).Values = "=dataPRVCAR!R814C" & FCColRef & ": R866C" & FCColRef
        If Range("X4").Value = "5+7" Then ActiveChart.SeriesCollection(2).Values = "=dataPRVCAR!R867C" & FCColRef & ": R919C" & FCColRef
                                                            ActiveWindow.Visible = False
    'HOMECHART
                                                            ActiveSheet.ChartObjects("Chart 499").Activate
                                                            ActiveChart.PlotArea.Select
                                                            ActiveChart.SeriesCollection(1).Values = "=dataPRVHOME!R6C" & ActColRef & ": R58C" & ActColRef
        If Range("X4").Value = "0+12" Then ActiveChart.SeriesCollection(2).Values = "=dataPRVHOME!R814C" & FCColRef & ": R866C" & FCColRef
        If Range("X4").Value = "5+7" Then ActiveChart.SeriesCollection(2).Values = "=dataPRVHOME!R867C" & FCColRef & ": R919C" & FCColRef
                                                            ActiveWindow.Visible = False

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Setting Series Values In VBA

    What sort of charts?

    Do you have any missing values or cells that may contain errors?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-02-2005
    Location
    London, England
    MS-Off Ver
    Office 2003
    Posts
    11

    Re: Setting Series Values In VBA

    Hi Andy,

    Thanks for getting back to me.

    The charts are just standard run of the mill line charts with 2 data series. The data that feeds the charts contains no errors at all, there are some zero values but these are shown in the charts ok when it works (as i would expect them to do).

    The charts show forecast vs actual performance based upon different metrics (calls, quotes, sales etc) which is why i need to be able to change the data series when the user selects a different cut of data.

    Thanks

    EddiesVoicebox

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0