If a component supports object linking and embedding (OLE), you can link or embed an object into your application without writing any code by using the component's visual interface. You can use a component's visual interface in one of two ways:
The OLE container control gives you the most flexibility in using an object's visual interface. With the OLE container control, you can:
An OLE container control can contain only one object at a time. There are several ways to create a linked or embedded object in the OLE container control — the one you choose depends on whether you are creating the linked or embedded object at design time or run time. Once you have an OLE container control drawn on your form, you can insert an object into the container control by:
For More Information For more information on using the OLE container control, see "OLE Container Control" and "Containers for Controls" in "Using Visual Basic's Standard Controls."
In the same way that you use the Toolbox to add one of Visual Basic's built-in controls to an application, you can use the Toolbox to add an object. First, add the object's class to the Toolbox, then add the object to a form.
To add an object's class to the Toolbox
For example, to add a Microsoft Excel Worksheet button to the Toolbox, select Microsoft Excel Worksheet.
Once you've added the object's class to the Toolbox, you can draw it on a form to create an object of that class. For example, after you add a Microsoft Excel Worksheet button to the Toolbox, you can draw it on a form to create a worksheet object on the form.