VBA/Excel/Access/Word/Excel/Chart Export

Материал из VB Эксперт
Перейти к: навигация, поиск

Creates web page with interactivity from an embedded chart

 
Sub SaveChartWeb()
    ActiveWorkbook.PublishObjects.Add _
        SourceType:=xlSourceChart, _
        Filename:=ActiveWorkbook.Path & "\Sample2.htm", _
        Sheet:=ActiveSheet.name, _
        Source:=" Chart 1", _
        HtmlType:=xlHtmlChart
    ActiveWorkbook.PublishObjects(1).Publish (True)
End Sub



exports the active chart as a GIF file:

 
Sub ExportChart()
    Dim myChart As Chart
    Set myChart = ActiveChart
    myChart.Export Filename:="C:\Chart.gif", Filtername:="GIF"
End Sub