Section 12.4. Pictures and Other Objects


12.4. Pictures and Other Objects

Charts are not the only graphic possibilities with Excel. Bitmaps produced with Paint can be added to a worksheet and can even function as buttons if needed. Figure 12-5 is a visual representation of a photo printing process drawn with Paint.

Figure 12-5. Photo printing process


The images were drawn individually in Paint. Figure 12-6 is the camera bitmap.

Figure 12-6. Camera bitmap


Images like this can be drawn quickly and it only took a few minutes to draw the whole process. Each picture was cut and pasted onto the worksheet where it was formatted with no line or fill.

Pictures are not the only thing you can paste into Excel. You can insert objects for many kinds of information.

I have a sound file named test.wav in my C:\My Music folder, and I want to add it to my worksheet. I start by clicking on Insert Object. The dialog in Figure 12-7 is displayed.

I click the "Create from File" tab, bringing up Figure 12-8.

Here I select Browse and navigate to the C:\My Music folder. Then I click on test.wav, inserting it onto the sheet. The result is a Sound Recorder Document object named object 1, as shown in Figure 12-9.

Figure 12-7. Inserting an object


Figure 12-8. Specifying the file


I can play the sound manually by double-clicking on the object, or I could put the following code into a module using the Visual Basic Editor.

 Sub PlayTheSound(  )     ActiveSheet.Shapes("Object 1").Select     Selection.Verb Verb:=xlPrimary End Sub 

Figure 12-9. A Sound Recorder Object


I can run this code from a button or tie it to an event, such as opening the workbook or selecting the sheet.

This could just as easily be a video clip or even the address of a web page. In most cases, Excel will already know how to handle the file you select based on the file type, and the code to activate the object is the same.

Excel can do far more than just display columns of numbers. You can include almost any kind of resource needed to make your display effective.



Analyzing Business Data with Excel
Analyzing Business Data with Excel
ISBN: 0596100736
EAN: 2147483647
Year: 2006
Pages: 101
Authors: Gerald Knight

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net