none
UpdateChartData method RRS feed

  • Question

  • I am using MS Project 2013 Pro (desktop client) and trying to set up the dashboards for my users to see our utilization rates.  Part of this is a chart with rolling dates.  I was trying to use the Update Chart Method but keep getting a run time error '5' - Invalid procedure call or argument.  How do I correctly call or define the arguments for this method?  I used similar code for other chart object functions but it doesn't seem to work for UpdateChartData. 

    The code I attempted to use is:

    Option Explicit
    Sub draft_RPT_update_rolling4month()
    On Error Resume Next
    Dim chartshape As Shape
    Dim reportName As String
    reportName = "FlexSteel Technician Overview"
    ActiveProject.Reports(reportName).Apply
    Set chartshape = ActiveProject.Reports(reportName).Shapes("Chart 11")
    chartshape.Chart.UpdateChartData Task:=True, Timephased:=True, StartDate:=CDate(DateAdd("d", -60, Date)), finishdate:=CDate(DateAdd("d", 60, Date))
    
    End Sub

    I am barely a novice at VBA and am sure that I am making a very simple mistake. Please help!

    Regards

    DChoate

    Monday, September 29, 2014 3:58 PM