Background:
I have a word document which I have set a macro to run upon open which selects an embedded chart object and opens an embedded excel workbook consisting of a data sheet and the chart sheet. The embedded workbook then has its own macro set to run upon opening that performs a data import from another closed workbook into the data sheet. It then reselects the chart sheet and closes the workbook, which brings the user back to the word document with the chart fully updated.
Independently, each macro works fine, but when I try to cascade them, Object definition issues arise: "run-time error '1004': Method 'Range' of object '_Global' failed". After doing a little research in VB help, I found that for embedded charts, you need to insert a new class module and declare an object of type chart with events. Then you have to connect the declared object in the class module with the embedded chart.
My programming experience is minimal; however, this does sound like the solution. I have no idea how to implement it or whether or not it should be done in the word and/or the excel macro. Can someone please help.
Note: The word macro runs fine and successfully selects and opens the embedded chart... it is the excel macro in which it stops up on right away on the definition issue.
I have a word document which I have set a macro to run upon open which selects an embedded chart object and opens an embedded excel workbook consisting of a data sheet and the chart sheet. The embedded workbook then has its own macro set to run upon opening that performs a data import from another closed workbook into the data sheet. It then reselects the chart sheet and closes the workbook, which brings the user back to the word document with the chart fully updated.
Independently, each macro works fine, but when I try to cascade them, Object definition issues arise: "run-time error '1004': Method 'Range' of object '_Global' failed". After doing a little research in VB help, I found that for embedded charts, you need to insert a new class module and declare an object of type chart with events. Then you have to connect the declared object in the class module with the embedded chart.
My programming experience is minimal; however, this does sound like the solution. I have no idea how to implement it or whether or not it should be done in the word and/or the excel macro. Can someone please help.
Note: The word macro runs fine and successfully selects and opens the embedded chart... it is the excel macro in which it stops up on right away on the definition issue.