19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FIGURE 13-2 Dialog Box for Inserting Contents of a File into an OLE Container Control.<br />

■ AN EMBEDDING WALKTHROUGH USING EXCEL<br />

1. Press Alt/File/New Project <strong>and</strong> click on OK.<br />

2. Click the OLE icon in the Toolbox <strong>and</strong> use the single-click-draw technique to<br />

create a very large rectangle on the form.<br />

3. The Insert Object dialog box appears. Double-click on “Microsoft Excel Worksheet”<br />

in the Object Type list.<br />

Excel will be invoked <strong>and</strong> you will be able to create a spreadsheet. (Most likely,<br />

the Excel menu bar will replace the <strong>Visual</strong> <strong>Basic</strong> menu bar. In some cases,<br />

the Excel menu bar will appear on the form just below the title bar.)<br />

4. Enter data into cells as shown in the first three rows of the spreadsheet in Figure<br />

13-3<br />

5. Drag to select cells A1 through F3.<br />

6. If you are using Excel 97, click Insert, click Chart, <strong>and</strong> then proceed to Step 8.<br />

If you are using Excel 95, click Insert, then Chart, <strong>and</strong> then On This Sheet.<br />

7. (A new mouse pointer consisting of a thin plus sign <strong>and</strong> a small bar chart<br />

appears.) Move the mouse pointer to cell A5, drag to the bottom-right corner of<br />

the OLE Container control, <strong>and</strong> then release the left mouse button.<br />

A Chart Wizard dialog box appears.<br />

8. Click on the Finish button.<br />

Your spreadsheet should be similar to the one in Figure 13-3.<br />

FIGURE 13-3 An Excel Spreadsheet<br />

OLE 389

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!