I have an excel workbook (v2016), where I managed to get the table name of a table based on the highest number of entries. This value (which is a name of a table) is in Sheet "Pareto" Cell B4.
I'm using the following code to update a chart using an above-mentioned table name
Sub GetTables()
Dim YTDL1TableName As String
Dim YTDL1Range As Range
YTDL1TableName = Sheets("Pareto").Range("B4")
Set YTDL1Range = Sheets("Pareto").Range(Sheets("Pareto").ListObjects(YTDL1TableName).Range.Address(True, True))
Sheets("Pareto").ChartObjects("YTDL1").Activate
ActiveChart.ChartArea.Select
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = YTDL1TableName
ActiveChart.SetSourceData Source:=YTDL1Range
End Sub
While the charts do get updated I do get an error
Runtime Error '445' : Object doesn't suuport this action
How do I get rid of this error?
Thanks in advance