In this article I will explain converting excel chart as an image in a simple
way.
Open Visual Studio >> File >> New >>Project
choose console application from C# Project Window.
Right click on ExcelChartToImage solution and select Add Reference.
In Add reference window Select Excel 12.0 Object Library from .Net tab.
Click on Ok button to add excel reference.
Add following namespace on the header of Program.cs file.
using
xl = Microsoft.Office.Interop.Excel;
Add following code to convert Excel chart as an image.
GetChart contains following arguments
- strFilePath- Give path of excel
file i.e. "C:\xlChart.xlsx".
- strDestPath- Give the destination
image file path i.e. c:\xlChart.jpeg.
To release com object add following code:
Please download complete code for convert excel chart as image.
Thanks for reading article..