Saves a Chart as a specified image format at a specified file path with the specified dimensions in pixels.

 public static void SaveImage(String filePath, ImageFormat imageFormat, int? width, int? height)
Public Static Sub SaveImage(ByVal filePath As String, ByVal imageFormat As ImageFormat, ByVal width As int?, ByVal height As int?)

A string representing the filepath you would like to save the image to.

The file format ExcelWriter will save the chart as. Supported file types include GIF, JPEG, BMP, PNG, EMF, TIFF, and WMF

The width of the image in pixels

The height of the image in pixels.

 

If there is a problem creating, opening, or writing to the file specified, or reading from the Chart object.

           ExcelApplication xla = new ExcelApplication();
           Workbook WB= xla.Create(FileFormat.Xlsx);
           Chart chartOne= WB[0].Charts[0];          
           chartOne.SaveImage("Path/filename.png", System.Drawing.Imaging.ImageFormat.Png, 240, 180);            
	   Dim oExcelApp As New ExcelApplication()           
           Dim wb As Workbook = oExcelApp.Create(FileFormat.Xlsx) 
           Dim chartOne As Chart = WB[0].Charts[0]          
           chartOne.SaveImage("Path/filename.png", System.Drawing.Imaging.ImageFormat.Png, 240, 180)