Chart Data Source / Worksheet.RemoveAt Issue 2

The attachment to the previous thread does not fix the issue where a chart’s datasource is changed when the worksheets.removeat method is called.

If I comment out the single line of code that removes a worksheet using the worksheets.removeat method the charts and graphs retain the correct datasource.

I will try to narrow down the test case scenarios to find the issues.

The attached zip file contains a project and template that demonstrate the following issue. After running the app and executing the “Issue 1” command button, you can see that the chart’s data source on “2005 ReportC” points to “2004 ReportC”.

I forgot to mention that if you comment out the following liine of code:

_WorkBook.Worksheets.RemoveAt(“Report2”)

Then chart’s data source on “2005 ReportC” accurately points to “2005 ReportC” NOT “2004 ReportC”.

Thanks again for all of the help…

Please try this fix.

The fix has resolved the problem. Thank you!