PCG FAQ

[Use your browser's BACK button to return to the PRIME FAQ Page or click here if you came directly to this page.]

How to Resolve Scaling Problems with Excel Chart Objects Embedded in Word

This was taken from "The Underground Guide to Office, OLE 2, and VBA", Chapter 3, and can be found under the heading Scaling Issues—Excel Charts. This material has been updated for Office 95.

Click here to order The Underground Guide to Microsoft Office, OLE, and VBA from Amazon.

This is probably the most common scaling problem we encounter. Say you have a chart in Excel. Embed said chart in a Word document. Try and tweak the size of the chart and the chart is fubar. Happens all the time.

There are two types of charts generated in Excel. Charts are either located in a chart sheet or they are (just to really confuse everyone) embedded on a worksheet. In keeping with Microsoft’s shaky terminology we’ll call them "chart sheet chart" and "worksheet chart." Either type can be embedded in a Word document.

Here is an example of a worksheet chart embedded in a Word container document. See Figure 3.28.

TUGOffice Figure 3.28

Figure 3.28 An Excel Worksheet Chart Embedded in Word

Select the chart and you can resize it via the sizing handles discussed earlier. But resize a chart like this at your peril. Here’s what you get if you try to make it smaller. See Figure 3.29. Then again, given all the wacko problems caused by different video drivers, you might get this result or as Monty Python was fond of saying, "something completely different."

TUGOffice Figure 3.29

Figure 3.29 Same Chart Scaled Smaller

Not so good, is it? What’s that in the background? It’s the worksheet that this chart is embedded in, in Excel, which is now embedded in Word along with everything else in the Excel workbook. The presentation has gone gonzo but is easily fixed in Word. When you embed a data object in Word, the Word program uses what is called an embed field to control the encapsulated data. If you turn on field codes (Tools / Options / View filecard / check the Field Codes check box), you’ll see this field code in place of the displayed object.

{EMBED Excel.Chart.5 \s}
The trouble is that trailing backslash ess, "\s". Just delete it. Make it look like this:
{EMBED Excel.Chart.5}
Oh, and you have to remove it before it gets trashed or removing it won’t help. An embedded chart sheet chart or an embedded worksheet chart with the offending \s removed can be resized by just selecting the object and dragging the sizing handles. Like so. See Figure 3.30.

TUGOffice Figure 3.30

Figure 3.30 Rescaled Without Display Disaster

The Naked PC
Subscribe to our free electronic newsletter. Get the latest on all things PC, updates to PRIME Freeware page, and more. Type your email name and click Subscribe.

Return to Top