Microsoft Office Tutorials and References
In Depth Information
Exporting Charts as GIF Files
dialog box that’s displayed when this macro is executed. If the Cancel button is
clicked, the function returns False. In such a case, the macro ends with no action.
Sub SaveAsGIF()
Dim FileName As Variant
If ActiveChart Is Nothing Then
MsgBox “Select a chart.”
Exit Sub
End If
‘ Get the filename
FileName = Application.GetSaveAsFilename( _
InitialFileName:=ActiveChart.Name & “.gif”, _
FileFilter:=”GIF Files (*.gif), *.gif”, _
Title:=”Save chart as GIF file”)
If FileName <> False Then
ActiveChart.Export FileName, “GIF”
End If
End Sub
Figure 16-13: Using the GetSaveAsFilename function to prompt
for a filename and directory
The JWalk Chart Tools add-in, available on the companion CD-ROM,
includes a utility to export charts as GIF files.
Search JabSto ::




Custom Search