Hi Folks,
I am trying to figure out the syntax to assign individual charts to individual variables in my macro rather than loop through each chart to send them to PowerPoint.
Using the syntax below throws a run-time error 91, Object variable or With block variable not set even though I have seen this syntax in other uses.
I have a lot of charts in a worksheet so would like to select (not manually) two of them and assign to variables to copy and paste elsewhere.
Any ideas?
The error point
I am trying to figure out the syntax to assign individual charts to individual variables in my macro rather than loop through each chart to send them to PowerPoint.
Using the syntax below throws a run-time error 91, Object variable or With block variable not set even though I have seen this syntax in other uses.
I have a lot of charts in a worksheet so would like to select (not manually) two of them and assign to variables to copy and paste elsewhere.
Any ideas?
VBA Code:
Dim chtA As Chart 'Excel.ChartObject
Dim chtB As Chart ' Excel.ChartObject
chtA = Sheets("Sheet1").ChartObjects("Chart 33").Chart
chtB = Sheets("Sheet1").ChartObjects("Chart 35").Chart
The error point