Working with Excel and Powerpoint I can copy a range from Excel and paste it into a Powerpoint slide with options of:
Use destination style
Use source formatting
Embed
Picture
Keep text only
Is it possible to copy a range from an Excel file to an Aspose slide and keep source formatting? In this case the pasted object is a formatted table that can be edited in the slide, rather than an image.
Alternatively, you may render range to image via Aspose.Cells and then insert the image into PowerPoint slide via Aspose.Slides but I guess this does not suit your needs.
When you use option 3, it will embed Excel worksheet range as OLE object, so when you double click on the picture in Powerpoint slide, it will navigate you to original Excel workbook, where you may update or edit the cells as well.
You may copy remove unnecessary content/data and retain/keep only your desired range via Aspose.Cells before rendering/saving to PowerPoint presentation file.
Clearly Aspose Cells has the ability to render workbook ranges as tables in a slide because it is done when I do workbook.Save(“SAVE.pptx”, Aspose.Cells.SaveFormat.Pptx). It would be great if the API exposed the functionality in such a way that I could build my slides in a piecemeal fashion from specific ranges within my workbook(s).
Currently, Aspose.Cells can render an Excel workbook to a PowerPoint presentation file. However, you need to choose an option that will give you results close to your requirements.
@kippow,
Aspose.Slides is not intended for managing or parsing Excel sheets. On the other hand, Aspose.Cells can already export Excel workbooks to PowerPoint presentations. I think it would be great if Aspose.Cells allowed you to select ranges of cells to export and keep source formatting for tables.
I’ve moved the forum thread to the Aspose.Cells forum. My colleagues will help you further.
@kippow
If you only want to export a certain range to pptx format, you can first set the printing area and then export file to pptx. Please refer to the following code and attachment (51.0 KB).
Workbook wb = new Workbook(filePath + "sample.xlsx");
wb.Worksheets[0].PageSetup.PrintArea = "A4:D20";
PptxSaveOptions saveOptions = new PptxSaveOptions();
wb.Save(filePath + "out.pptx", saveOptions);