Search code examples
vbaexcelpowerpointexcel-2016office-2016

Fails to set source data on MS Office 2016 charts


I am trying to set source data for a MS Office 2016 chart in VBA, but recieve error "Object doesn't support this property or method".

The same code works fine with older chart types.

To be more specific, the chart type I am trying to generate is the xlWaterfall.

Usually I would have recorded a macro, but it does not seem work with MS Office 2016 chart types yet.

Functional code:

Works fine :

Crashes at .setSourceData :

Appreciate your help. Thanks in advance.


Solution

  • Strange that the setDataSource method crashed, but I found a work around: When first selecting the preffered range and then creating the chart with the range selected, it was set as data source by default.

    Solution