We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Converting Excel file to PPT file


I am trying to convert an Excel file to a PPT file using Aspose Cells and Aspose PDF components. I keep getting this error "This file's format is not supported or you don't specify a correct format.". I am executing the code from asp.net page. what am I doing wrong, please see code below?



Below is my code:

//Instantiate an instance of license and set the license file through its path

Aspose.Grid.Web.License license = new Aspose.Grid.Web.License();


//Get the path of the Application folder.

//string path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Request.PhysicalApplicationPath), "..\\..");

string path = Request.PhysicalApplicationPath;

//Get the template excel file path.

string designerFile = path + @"Files\Availability_By_Days.xls";

//Specify the xml file path.

string xmlFile = path + @"Files\Availability_By_Days.xml";

//Specify the pdf file path.

string pdfFile = path + @"Files\Availability_By_Days.pdf";

//Create a new Workbook.

Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();

//Open the template excel file which you have to

//convert to pdf file.

wb.Open(designerFile, FileFormatType.Excel2003);

//First, Save the xls file in xml file (Aspose.Pdf


wb.Save(xmlFile, FileFormatType.AsposePdf);

//Create a new Pdf object.

Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();

//Now, Bind the xml file (Aspose.Pdf integrated), which

//is used as a medium file for conversion.

pdf.BindXML(xmlFile, null);

//Save the pdf file.



Well, your template file does not seems to be a native excel file. Could you post your template .xls file here, we will check your issue soon.

Thank you.

Hi Amjad,

Thanks for replying to my post. You were correct. I had to open the file in Excel and save it again as an Excel file to get it to work.

My company had paid for a subscription to Aspose Total and the subscription ended on 11/17/2007. If I need to create an Excel using Aspose Cells, convert it to PDF using Aspose PDF and then finally convert it to PPT using Aspose pdf converter will I be able to do it with the functionality existed in Aspose Total prior to 11/18/2007? Please see attachment for reference to my code.



Hi David,

Well, yes, the functionality (Xls2Pdf) is there in the older versions of Aspose.Total (Aspose.Cells for .NET and Aspose.Pdf for .NET) and you may try it for your requirements. Although, there might be some enhancements for the feature (Xls2Pdf) in the latest versions/fixes of Aspose.Cells for .NET and Aspose.Pdf for .NET.

Thank you.