Using Compound Documents
In this exercise, you will add a Microsoft Excel Chart to a Visual Basic form as an OLE compound document. Support will be automatically provided for in-place editing.
* To create the Visual Basic project
- Start Visual Basic and create a new Standard project.
- Add a new OLE control to the form.
- From the Object Type list, select Microsoft Excel Chart and click OK .
A sample chart will be displayed in the control. In-place editing will automatically be enabled.
- Press the ESCAPE key to return the Visual Basic toolbar.
* To test in-place editing
- Run the application.
- Double-click the Microsoft Excel chart.
This will begin in-place editing. Notice the Excel menu that is presented on the form.
- From the View menu, select Toolbars and click Chart .
The Microsoft Excel chart toolbar will become visible.
- From the Chart toolbar, click Chart Type .
- Click 3-D Bar Chart and notice the changes to the embedded chart object.
- Press ESCAPE twice to disable in-place editing and return to Visual Basic.
The chart has been updated with the new type.
- Stop the application and exit from Visual Basic.