What Is OLE? VB Help

In the past, software development tools were uniform throughout, allowing little, if any, variation and component exchange with other tools. Programming environments were thought of as islands, somewhat isolated from other applications.

Programmers used structured programming techniques to analyze programming problems in terms of procedures and then implement those procedures.

However, with the introduction of OLE, software development has been significantly transformed from procedural to object-oriented programming, You no longer have to work with prepackaged tools. You can create self-contained Modules, or objects, that greatly simplify programming, especially when it comes to building large applications. In the previous chapters, you learned how to use Visual Basic objects to build applications. With OLE, you cat} use both Visual Basic objects and objects exposed by other applications to do the same. As a result, your applications no longer will be islands of functionality. They will be an integral part of the operating system and its applications.

Component Software

The essence of OLE is component software. A component is an item (a control or an application) that someone else has developed. You don’t have to reinvent it to use it in your applications. If the component supports OLE, you can “borrow” its functionality for your own purposes Microsoft Word, for example, comes with a powerful spell-checker. Why buy another spell-checker or write your own when you can borrow this functionality from Word?

A developer of component software views a program as a combination of components working together to provide a common interface standard for OLE applications. For example, the functionality of a spreadsheet can be available in a word processing document and vice versa. Or, a Visual Basic application can borrow functionality from both a word processor and a spreadsheet.

Compound Documents

A.document that contains more than a single type of object is called a compound document. For example, a Microsoft Word document that contains an Excel work- . sheet or an image is a compound document. There have been attempts to develop all-in-one applications to handle text, numbers, images, communications, and every other aspect of computing upon which the average user relies, but they have all failed-until the advent of OLE technology.

The folks at Microsoft recognized the need of the average user to integrate favorite applications. They also understood that the all-in-one approach was not feasible, so they came up with OLE, which is a way for applications to exchange both data and functions. Because OLE applications can communicate with each other, end users can put together the pieces they need to create their own all-in-one software. the beauty of OLE is that the ‘application that calls upon the services of another application doesn’t need to know much about it, short of how to accomplish the task. In the way, you, the Visual Basic programmer, don’t need to know much about the operation of the RichTextBox or MSFlexGrid control, short of the properties and methods that let you manipulate them.

A Data-Centered Approach

OLE allows the user to take a data-centered approach to a program instead of a product approach. The user needs to consider what needs to be done, not how it should be done or which application should be used for the task at hand. For example, in a component software environment, the user doesn’t have to work exclusively with an Excel spreadsheet to manipulate numbers or with Word Perfect to manage text. An OLE application provides the user access to the functionality of a spreadsheet, a word processor, or a graphics application, within one environment called a container application. As you’ll soon see, Visual Basic lets you build components that can share functionality with other applications, as well as applications that can host compound documents.

Posted on November 6, 2015 in OLE Automation and VBA

Share the Story

Back to Top