Microsoft Office Tutorials and References
In Depth Information
Use a simple VBA macro
Use a simple VBA macro
Another way to save charts as GIF files is to use a VBA macro. The following
macro, for example, saves all embedded charts on the active worksheet as GIF files.
The files are saved in the current directory, and the filenames include the worksheet
name and the chart name.
Sub SaveChartsAsGIF ()
Dim ChtObj As ChartObject
Dim Counter As Long
For Each ChtObj In ActiveSheet.ChartObjects
With ChtObj
.Chart.Export .Parent.Name & “ “ & .Name & “.gif”, “GIF”
End With
Counter = Counter + 1
Next ChtObj
MsgBox Counter & “ charts were saved in “ & CurDir
End Sub
This macro is very rudimentary and does no error checking. In addition, it will
overwrite existing files with the same name. Refer to Chapter 16 for additional
macros that export charts.
The author’s JWalk Chart Tools, available on the companion CD-ROM, includes
a more versatile utility to save charts as GIF, JPEG, TIF, or PNG files.
Using Excel Charts in
PowerPoint or Word
This section describes how to use Excel charts in Microsoft PowerPoint. Although
the examples use PowerPoint, the same procedures work in Word.
Creating charts in PowerPoint
If you use PowerPoint to prepare presentations, you may be familiar with
PowerPoint’s built-in chart feature. Well, it’s not really built in. It makes use of
Microsoft Graph, an “embeddable OLE applet” that is also available in other
Microsoft Office applications, including Word.
Search JabSto ::

Custom Search