Vba Activate Chart Fails

Vba Activate Chart Fails

Apr 11, 2011 Technical Articles Creating Charts with VBA in Word..Chart ' Activate the data before you can access the workbook salesChart.ChartData.Activate. For all general questions relating to Excel but not including VBA or formulas. I know that using Activate and Select in Excel VBA is. Avoiding the use of Activate and Select when working. Avoiding the use of Activate in Excel VBA for Chart.

Books at Amazon.com Quick Excel Chart VBA Examples The use of VBA in Microsoft Excel charting is a topic that would fill a large volume. John Vanderslice Emerald City Rar. The examples here are straightforward illustrations of easy techniques to create charts, add and remove series, and move and resize charts using VBA.

Very new to Excel VBA here. Very similar to this post:, I am attempting to avoid using Activate in order to make a small change to a number of Charts in a large workbook. I am performing this task for a good number of charts, so I would like to minimize the run-time as much as possible and have heard that the select/activate functions tend to slow down macros. My example code looks like this: ActiveSheet.ChartObjects('Chart 3').Activate ActiveChart.FullSeriesCollection(1).XValues = '=Leb!$C$2:$G$2' I have attempted to replace these two lines with the following since this makes logical sense to me: ActiveSheet.ChartObjects('Chart 3').FullSeriesCollection(1).XValues = '=Leb!$C$2:$G$2' This code causes an error when run, so I then attempted to use the WITH format shown by the post mentioned above: With Worksheets('Chart').ChartObjects('Chart 3').Chart.XValues = '=Leb!$C$2:$G$2' End With This also throws an error. I understand that I am probably making a small, syntax error, but would anyone be able to provide any insight into what I am doing wrong? (I have never used the WITH function before, so some general insight on it would be very helpful as well.) Thanks in advance.