I have a macro that updates a ppt presentation charts from a monthly updated Excel file. It has been working like a charme for a couple of months. Since a few days ago, I have a problem to close the charts Workbook after updating their numbers and I get a 1004 runtime error.
Here is the code :
With .Slides(1).Shapes("gmbDiscoveryRateChart").Chart.ChartData
.Activate
.Workbook.Sheets(1).Range("B2").value = currentGmbDiscoveryRate
.Workbook.Sheets(1).Range("B3").value = 1 - currentGmbDiscoveryRate
.Workbook.Close '<-- Error here
End With
End With
writeThisworkbook.Close
– MGP