For anyone who was reading this and looking to do the same thing with charts I finally got it resolved. The below code works and you can also use the same code to update the chart series by adding the following, please note the series position is dynamic number value since I want to loop through every series to update them.
workbook.ActiveChart.FullSeriesCollection(Series_Position).Name = ("=" & Source_Worksheet & "!" & Source_Range)
workbook.ActiveChart.FullSeriesCollection(Series_Position).Values = ("=" & Source_Worksheet & "!" & Source_Range)
Full code
---------------------------------------------------------------
Dim sw, dw As Object
Dim ss, ds As Object
'Dim activeCell AS Object
Dim excel, sheet, source, workbook As Object
Try
sw = GetWorkbook(CInt(Handle), Source_Workbook)
ss = GetWorksheet(CInt(Handle), Source_Workbook, Source_Worksheet)
sw.Activate()
ss.Activate()
excel = ss.Application
sheet = excel.ActiveSheet
workbook = excel.ActiveWorkbook
sheet.ChartObjects(Chart_Name).Activate()
workbook.ActiveChart.FullSeriesCollection(1).XValues = ("=" & Source_Worksheet & "!" & Source_Range)
Success = True
Message = Chart_Name & " successfully updated"
Catch e As Exception
Success = False
Message = e.Message
Finally
sw = Nothing
ss = Nothing
dw = Nothing
ds = Nothing
excel = Nothing
sheet = Nothing
source = Nothing
End Try
------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------
#MVP