Since the advent of Windows in the mid-1990s, Object Linking and Embedding (OLE) has become one of the most essential and far-reaching technologies in the computing world. But unlike a lot of technologies, which are interesting buzzwords or fodder for geeky white papers, OLE is much more than just another term you need to know. Quite the contrary, OLE is technology you can-and should-master and apply to your daily work whenever you have the opportunity.
What is OLE, what does it do, and how can you use it? This article will briefly answer these questions and give you a quick hands-on lesson that will let you see OLE at work in a real application.
What Is OLE?
Without getting into technical details, it's enough to describe Object Linking and Embedding as a technology that enables software programs to share data. This means more than just copying some data from one document and pasting it into another document (although this process involves OLE, too).
Rather, in OLE, a shared piece of data is regarded as an object-a piece of data that can be selected and manipulated without necessarily affecting any other data. For good examples of objects, think of a drawing created in a program such as CorelDRAW, or a chart created in Excel. But other types of data can be selected and treated as objects, too, such as a block of text in a Word document or a record from an Access data table.
Because of OLE, you can create a chart in Excel, copy it, and paste the copy into a document in Word. But you can also go beyond the copy-and-paste operation. You can link the copied chart back to its original file in Excel (the source file). Then, if you make changes to the original file, the changes are automatically made to the copied chart in the Word document (the target or destination file). Using OLE, you can make a copy of an object, embed the object in a second document, and link the copied object back to its original source.
The heart of OLE technology is found in the operating system, such as the Clipboard feature of the Windows and Macintosh operating systems. Without core support from the operating system, applications would not be able to share data in a meaningful way. But applications must support OLE, too, and luckily nearly all Windows- and Macintosh-based software produced in recent years is OLE-compliant. This means that many different types of applications can exchange data via the operating system, making it easier for users to create complex documents with data from various sources.
What Can You Do With OLE?
Programmers do all sorts of innovative things with OLE technology to make applications work together in a seamless way. But as a computer user, you can benefit from OLE in your daily work, especially if you need to use more than one application.
Let's go back to the example of our Excel chart. Suppose that you work in an accounting department and you track a company's monthly revenues. You do this in Excel, typing in sales figures as they become available, totaling them, and analyzing them in various ways. Once every three months, you prepare a quarterly report for the company's managers, summarizing revenues for that quarter. Accountants commonly use charts for this purpose, and Excel makes it easy to create charts from the numbers in a worksheet.
To get ahead, you create your report in Word a few weeks early. Even though the final data for the quarter isn't ready, you can still prepare a report that will ultimately be accurate. To do this, you create a chart in Excel that summarizes the quarter's revenue. In Excel, you select the chart and copy it, using the Copy command on the Edit menu.
In Word, you open your report, then embed the Excel chart by using the Paste Special command on the Edit menu. This command enables you to identify the chart as an object, and link it back to the Excel worksheet where you created it. You save and close both documents.
Now, over the next few weeks, as you update the data in Excel, the chart changes to reflect your adjustments. Because you have already embedded the chart in Word, it is updated in your report, as well. When you are finally ready to print your report and give it to your managers, the revenue data is already up to date.
Here's a different example. Suppose you have created a slide in Microsoft PowerPoint and want to use it as an illustration in a Word document. In PowerPoint, you select the slide and copy it to the Clipboard using the Copy command. In your Word document, you use the Paste Special command to embed the PowerPoint slide as an object.
Now, suppose you are working in the Word file and discover that you need to make a change to the slide. If you double-click the object, it automatically opens in PowerPoint, enabling you to use PowerPoint's tools to make the changes. Without this kind of linking, you would need to delete the slide from the Word document, open PowerPoint, change and save the file, and copy back to the Word document again.
These examples describe only a couple of ways in which OLE can make your computer work faster and more efficiently. There are countless other ways, too, in applications ranging from e-mail to CAD, and everything in between.
The key benefit of OLE, from the end user's perspective, is that it enables you to re-use data with ease. You need to create data only one time, then you can use it again and again in various documents. If you change the original data, your changes are reflected in any other document that shares the data.
This approach not only is a more efficient use of computing resources, but it results in smaller files, too. Consider the Excel chart discussed earlier. If you simply used Word's Paste command to insert a copy of the chart into your report, the Word document would include the entire chart. Because you used the Paste Special command to create a link to the original chart in Excel, however, the resulting Word file is smaller. The bulk of the original data is stored in the Excel file, and does not need to be re-created for the Word document.
When Not to Embed Objects
As you may have guessed, linked and embedded objects include references back to their source files, and this creates dependencies. In our Excel/Word example, the Word document depends on the original Excel file for all the source data in the chart. If the Excel file is moved from its original location, or if it is deleted, then Word cannot display the chart correctly.
For that reason, you need to be careful when using OLE to link and embed objects. Another good reason is that automatic updating isn't always desirable. What if you don't want the Word chart to reflect changes made in the Excel file? In this case, it's better not to use the Paste Special command to link the copied chart back to the original.
Hands-on Practice with OLE
You don't need multiple programs to see how OLE works. You only need to use one program that supports OLE. In fact, if you use one program primarily, you may find the Paste Special command to be extremely helpful for re-using data in a variety of documents.
Here's a simple example that demonstrates OLE at work, using only Microsoft Word 97 or 2000 and two simple documents:
1. Launch Microsoft Word.
2. Create one document and save it with the file name OLE1.DOC. For the document's first paragraph, type this text:
Now is the time for all good men to come to the aid of their country.
3. Save the file once again, and leave it open.
4. Create a second document and save it with the file name OLE2.DOC. Don't type any text in this document, but leave it open.
5. Return to OLE1.DOC, select the entire paragraph, open the Edit menu, and choose the Copy command.
6. Go to OLE2.DOC, open the Edit menu, and choose the Paste Special command. When the Paste Special dialog box appears, click the Paste Link option. In the As list, click Formatted Text (RTF). Click OK.
The text is embedded in OLE2.DOC as an object.
7. Save OLE2.DOC.
8. Return to OLE1.DOC. Click in the sentence, after the word "men". Type the words "and women" and press the Spacebar as needed to insert one blank space before and after the new words.
The sentence now reads "Now is the time for all good men and women to come to the aid of their country."
9. Save OLE1.DOC and return to OLE2.DOC.
The new text appears in the embedded sentence. Word has automatically updated the linked data.
10. Save OLE2.DOC. Close both documents.
You can try similar exercises in all your programs to see what kinds of options they give you for using the Paste Special command. As you practice, be sure to try embedding the data as different types of objects, to see how they behave. Then, extend your practice to include multiple programs and object types. This kind of practice will quickly help you master the use of OLE in your documents.