Hi,
Am a new user. If am posting in a wrong forum am sorry and please suggest me where I can get my problem solved.
The problem am facing is,
Am having 6 charts in an excel worksheet and am trying to export all the charts from excel to some jpeg file.
Only two charts getting exported and remaining charts after I export as Image, its empty (0 kb). I can see only empty jpeg file.
Am using C# and Asp.Net. The code what am using is,
using X1 = Microsoft.Office.Interop.Excel;
X1.Application x1App;
X1.Workbook x1WorkBook;
X1.Worksheet x1WorkSheet;
X1.Worksheet x1WorkSheet1;
object misValue = System.Reflection.Missing.Value;
x1App = new X1.ApplicationClass();
x1WorkBook = x1App.Workbooks.Open(@"C:\Temp\FlexPurchasing\XYZ.xls", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
x1WorkSheet = (X1.Worksheet)x1WorkBook.Worksheets.get_Item(2);
X1.ChartObjects x1Charts = (X1.ChartObjects)x1WorkSheet.ChartObjects(Type.Missing);
X1.ChartObject myChart = (X1.ChartObject)x1Charts.Item(3);
X1.Chart chartPage = myChart.Chart;
chartPage.Export("D:\\VPR_Image.jpeg", "JPEG",true);
x1App.Workbooks.Close();
x1App.Quit();
ReleaseObject(x1WorkSheet);
ReleaseObject(x1WorkBook);
ReleaseObject(x1App);
Please give me some suggestion to export all the 6 charts from excel.
I searched in most of the forum but I didnt get the required answer.
Please help me out in sorting the issue.
Urgent Please.
Bookmarks