Excel 2000
Windows XP
I have a workbook that opens another workbook, copies a worksheet into that workbook and runs functions from the copied worksheet. All of this works as expected until I try to activate a chart object within one of the functions.
To try and be more clear as to what the process is:
I've tried different sytax to activate the chart, all of which yeild the same stinking error "Activate method of ChartObject class failed".
Here are a few different ways I've tried to activate the sheet:
I've also done this:
I get a message box for each chart including "Chart 3".
And yes, it is absolutely necessary that one workbook opens another the way I described in the first paragraph.
Windows XP
I have a workbook that opens another workbook, copies a worksheet into that workbook and runs functions from the copied worksheet. All of this works as expected until I try to activate a chart object within one of the functions.
To try and be more clear as to what the process is:
- Workbook A contains Worksheet B that contains code.
- Workbook A contains code that opens Workbook X and copies Worksheet B into Workbook X.
- Workbook A then calls a function from the copied version of Worksheet B in Workbook X. This is where the code fails.
I've tried different sytax to activate the chart, all of which yeild the same stinking error "Activate method of ChartObject class failed".
Here are a few different ways I've tried to activate the sheet:
Code:
with ActiveSheet
...
.ChartObjects("Chart 3").Activate
...
end with
Code:
ThisWorkbook.Sheets(SHEET_NAME).ChartObjects(3).Activate
Code:
ThisWorkbook.Sheets(SHEET_NAME).ChartObjects("Chart 3").Activate
I've also done this:
Code:
for each co in activeSheet.ChartObjects
msgbox co.name
next
And yes, it is absolutely necessary that one workbook opens another the way I described in the first paragraph.