Microsoft Office Tutorials and References
In Depth Information
Method 3: Use a VBA macro
Save your workbook in a normal Excel file format first. The HTML version of your
workbook should be considered a temporary version of your workbook. Although you
can open the HTML file in Excel, this file format doesn’t preserve key information —
such as formulas.
Method 3: Use a VBA macro
This method uses a simple VBA macro that saves each chart on the active sheet as a GIF file.
To create the macro, first save your workbook. Then press Alt+F11 to activate the Visual Basic
Editor. Select your workbook in the Projects window and choose Insert
Module to insert a new
VBA module. Then type the following procedure into the module:
Sub SaveChartsAsGIF()
Dim ChtObj As ChartObject
Dim Fname As String
For Each ChtObj In ActiveSheet.ChartObjects
Fname = ThisWorkbook.Path & “\” & ChtObj.Name & “.gif”
ChtObj.Chart.Export Filename:=Fname, FilterName:=”gif”
Next ChtObj
End Sub
After the macro is entered, press Alt+F11 to reactivate Excel. Then activate the worksheet that
contains your charts. Press Alt+F8 to display the Macro dialog box. Select the SaveChartsAsGIF
macro and click Run.
The procedure saves each chart in the active worksheet as a GIF file. (The chart’s name is used as
the filename.) The files are stored in the same folder as the workbook.
Search JabSto ::

Custom Search