OLE Fundamentals

 

Object linking and embedding (OLE) is a technology that allows a programmer of Windows-based applications to create an application that can display data from many different applications, and allows the user to edit that data from within the application in which it was created.  In some cases, the user can even edit the data from within their application.

       

The following terms and concepts are fundamental to understanding OLE.

 

OLE Object

 

An OLE object refers to a discrete unit of data supplied by an OLE application.  An application can expose many types of objects.  For example a spreadsheet application can expose a worksheet, macro sheet, chart, cell, or range of cells all as different types of objects.  You use the OLE control to create linked and embedded objects.  When a linked or embedded object is created, it contains the name of the application that supplied the object, its data (or, in the case of a linked object, a reference to the data), and an image of the data. 

 

OLE Automation

 

Some applications provide objects that support OLE Automation.  You can use Enable Basic to programmatically manipulate the data in these objects.  Some objects that support OLE Automation also support linking and embedding. You can create an OLE Automation object by using the CreateObject function.

Class

 

An objects class determines the application that provides the objects data and the type of data the object contains.  The class names of some commonly used Microsoft applications include MSGraph, MSDraw, WordDocument, and ExcelWorksheet.