TFS in Excel: Exporting Charts Using VBA
Problem You want to automate the exporting of a chart within an Excel worksheet to a PNG image file using a VBA macro. Solution Private Sub ExportChartToFile(Worksheet as String, ChartNumber As Integer, Filename As String) Dim objChrt As ChartObject Dim myChart As Chart Dim FilePath As String Set objChrt = Sheets(“Worksheet”).ChartObjects(n) Set myChart = objChrt.Chart […]