I am using Visual Basic to manipulate Excel. In the code, I am trying to activate a chart.
The code is:
MyExcel.Application.ActiveWorkbook.ActiveSheet.ChartObjects("Chart 3").Activate
The error that I get in VB is:
Unable to get the ChartObjects property of the Worksheet class.
I am doing a loop to find the number value for the object (i.e., the 3), when I encounter an error, I increment a counter until I find the object. After finding the right one, I am presented with this error above.
Any ideas as to what I am doing wrong?
The code is:
MyExcel.Application.ActiveWorkbook.ActiveSheet.ChartObjects("Chart 3").Activate
The error that I get in VB is:
Unable to get the ChartObjects property of the Worksheet class.
I am doing a loop to find the number value for the object (i.e., the 3), when I encounter an error, I increment a counter until I find the object. After finding the right one, I am presented with this error above.
Any ideas as to what I am doing wrong?