This code worked out for me.Í'm doing it from access and the chart is not activating. so i had to use chartobjects to activate it. I used the following code.
appxl.Worksheets(1).ChartObjects("chart 1").Activate
appxl.ActiveChart.SetSourceData (appxl.ActiveSheet.Range(appxl.ActiveSheet.Cells(b eginrow,begincol), appxl.ActiveSheet.Cells(endROW,endcol)))
Thanks for your reply.