I want to draw some histograms of data on a worksheet, and I want a macro to do this.

I switched on "record macro", and drew a histogram of some of the data using Data > Data Analysis > Select Histogram and then filling in the ranges and so on. Then I stopped recording and looked at the resulting macro.

This looked like :
<code>
macro3
Application.Run "ATPVBAEN.XLAM!Histogram", ActiveSheet.Range(suchandsuch).........
.....(more stuff)
</code>

So then I rubbed out the histogram data columns, I rubbed out the chart of the histogram, saved everything, close the Excel workbook, re-open the Excel workbook.

Then I ran macro3, expecting it to re-draw the histogram.

But it didn't. It gave a debug error, highlighting in yellow the item I have summarised between <code>..</code>

Could someone explain this to me, please ? What should I have done ?