Hi All,
Here is a routine which converts the chart into a picture (GIF, BMP, JPG)
Put this macro in a Standard module.
and call the routine like ..Code:Public Enum PicType GIF = 1 JPG = 2 BMP = 3 End Enum Sub SaveChartAs(ByRef Chart_Object As ChartObject, ByVal PictureType As PicType, _ Optional ByVal FilePath As String, Optional ByVal FileName As String) Dim Extn As String Extn = Application.Choose(PictureType, ".GIF", ".JPG", ".BMP") If Len(FilePath) = 0 Then FilePath = ThisWorkbook.Path If Len(FileName) = 0 Then FileName = Chart_Object.Chart.Name & Extn Else FileName = FileName & Extn End If Chart_Object.Chart.Export FilePath & "\" & FileName, Mid$(Extn, 2) End Sub
Enjoy !Code:Sub kTest() SaveChartAs ActiveSheet.ChartObjects(1), JPG, "C:\Test", "MyImage" End Sub




Reply With Quote

Bookmarks