VBA: Method 'SetSourceData' of object '_Chart' failed For Multiple Pivot Charts

后端 未结 2 665
栀梦
栀梦 2021-01-24 18:12

This is part 2 of the previous question:

VBA: Runtime Error - SetSourceData for Second Pivot Chart

After following the (good) advice offered in that thread, I am

相关标签:
2条回答
  • 2021-01-24 18:24

    I had similar problem. I solved it by setting to nothing variables holding pivotcache and previously used pivottables (before adding second chart).

    0 讨论(0)
  • 2021-01-24 18:38

    I had this problem too, on the Excel 2016 64 bit build. Solved it using the technique above to create a shape object, instead of a chart object:

    Dim PChart as shape
    Set PChart  = PSheet.Shapes.AddChart
        With PChart.Chart
            .ChartType = xl3DColumn
            .SetSourceData Source:=p.TableRange1, PlotBy:=xlRows
        End With
    
    0 讨论(0)
提交回复
热议问题