Aspose queries

Hi
I have a few queries with Aspose. Can you please help me with -

  1. Is there a way I can generate slides using Aspose slides using Microsoft Office 2016 Styling ?
  2. I need to copy paste a chart from Excel to Powerpoint and link the Powerpoint to Excel. When I hit Edit Data on the Powerpoint chart, the Excel needs to open. The chart needs to be a proper chart, not an OLE object. I am using aspose cells and slides for Python via .net version 25.3
  3. Are there any differences in functionality between Aspose cells/slides with Python via .NET and Aspose cells/slides with Java ?

Thanks
Sukriti


This Topic is created by vladimir.litvinchik using Email to Topic tool.

@sukritisehgal,

I would like to reply your queries from Aspose.Cells for Python via .NET/Aspose.Cells for Java perspective.

  1. I think you can embed Excel Workbook (containing the chart) in OLE and add a chart image on top in the PowerPoint slide. For this, you will use Aspose.Cells to generate the Excel file to create your desired chart. Then, you may use Aspose.Slides to embed that Excel file as an OLE object. Finally, you may overlay the chart display as a PNG or EMF image to visually match it to be pasted on the slide. When, you double-click on the image in the Powerpoint slide, it will open underlying workbook in Excel, but it won’t be kind of live chart object. Do you need something different? Could you please create your desired task in MS Excel and PowerPoint manually, so kindly provide the final output Excel and PowerPoint files to show your requirements? We will check it.
  2. There is not much difference between Aspose.Cells for Python via .NET and Aspose.Cells for Java. Both are approximately same regarding API Coverage, features and functionalities. The docs for both are up-to-date and concise. Both show good performance when working with larger files.

One of my colleague from Aspose.Slides team will reply your queries regarding Aspose.Slides soon. @andrey.potapov FYI.

@sukritisehgal,
As for Aspose.Slides,

  1. Aspose.Slides doesn’t have a built-in option like “use Office 2016 style,” but you can emulate it by:

    • Loading a PowerPoint 2016 template (.pptx or .potx) created with the desired styles.
    • Inserting content into this pre-styled presentation so all elements inherit the 2016 look.
    • Applying themes from Office 2016 by copying slides from a styled template.
    • Manually setting fonts, colors, and effects that match Office 2016 defaults.
  2. Aspose.Slides currently supports embedding charts from Excel only via OLE objects or by creating charts programmatically using the API. Unfortunately, inserting a chart as a linked object in a way that allows it to open in Excel via the “Edit Data” option—without using OLE—is not supported.
    Additionally, DDE (Dynamic Data Exchange) is a deprecated Microsoft technology and is not supported by Aspose.Slides.

  3. There are no differences in functionality between Aspose.Slides for Python via .NET and Aspose.Slides for Java. Both APIs offer the same features and capabilities, as they are built on the same core codebase. This ensures full parity across platforms, so you can expect identical behavior and results regardless of the language or runtime you use.

Hi
Thank you for answers 1) and 3)
For answer 2)
I have another use case.
I have a Powerpoint with different Microsoft objects - text, tables and charts.
I also have a seperate Excel file with the same objects on the first Excel sheet. I want to to link each object from the Powerpoint to the Excel.

I have manually created my desired output in MS Excel and Powerpoint, it will be great if you can help me do this programmatically via Aspose. Can you please share an email address so I can email it to you ?
Thanks

@sukritisehgal,
You can zip the files and attach the archive to a message in this forum thread.

Please also describe in more detail what you would like to do with them.

Hi
It is not recommended to share the files on a public forum, as they are used within our firm.
If you can share an email address, that will be great.

Given a Powerpoint and an Excel, I want to to link each object from the Powerpoint to the Excel, i.e.

  1. If I edit the Powerpoint text or table, that should be reflected in the Excel.
  2. If I edit the Excel text or table, it should be reflected on the Powerpoint.
  3. If I click on a Powerpoint chart, it should open the Excel (they should be linked). If I update data in the Excel, it should change the Powerpoint chart.

I am ok with any approach that accomplishes this - OLE, DDE or anything else.
Thanks

I am also getting an error when I try to upload - “Sorry there was an error uploading the file. Please try again
I tried about 10 times. Confirming I tried to upload zip files.

@sukritisehgal,
Thank you for describing the use cases.

Please follow the instructions below to send us the files privately. We will mark them as confidential.
How to Send License File to Support Team

Hi Andrey

Appreciate you sharing a method so I can send the files privately.
However, I am still getting the error : Sorry, there was an error uploading that file. Please try again.

My zip files are 64 KB and 35KB in size, not sure why they are not getting uploaded. Is there any other way I can send them ? Please feel free to email me directly at [email protected]

@sukritisehgal,
Unfortunately, I can’t determine the cause of the error you encountered. We are sorry that you encountered this problem. Please send the files to [email protected].

@sukritisehgal,
I received your email. I will prepare the information and get back to you soon.

@sukritisehgal,
We have opened the following new ticket(s) in our internal issue tracking system and will address the issues according to the terms outlined at Free Support Policies.

Issue ID(s): SLIDESJAVA-39662

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks, please let me know if there is any solution on this.

@sukritisehgal,
We will keep you updated. Thank you for your patience.

@sukritisehgal,
Our developers have reviewed your requirements.

Please try using the following code example:

String excelFileName = "linked_excel.xlsx";
Presentation presentation = new Presentation();
ISlide slide = presentation.getSlides().get_Item(0);

Workbook workbook = new Workbook(excelFileName);
Range cellRange = workbook.getWorksheets().get("sheet1").getCells().createRange("G2:M12");

IOleObjectFrame frame = slide.getShapes().addOleObjectFrame(20, 300, 400, 200, "Excel.Sheet.12", excelFileName);
frame.setLinkPathLong(frame.getLinkPathLong() + getAddressOnWorksheet(cellRange));
frame.getSubstitutePictureFormat().getPicture().getImage().replaceImage(createOleImage(cellRange));
frame.setUpdateAutomatic(false);

cellRange = workbook.getWorksheets().get("sheet1").getCells().createRange("C2:E23");
frame = slide.getShapes().addOleObjectFrame(420, 20, 200, 100, "Excel.Sheet.12", excelFileName);
frame.setLinkPathLong(frame.getLinkPathLong() + getAddressOnWorksheet(cellRange));
frame.getSubstitutePictureFormat().getPicture().getImage().replaceImage(createOleImage(cellRange));
frame.setUpdateAutomatic(false);

cellRange = workbook.getWorksheets().get("sheet1").getCells().createRange("G18:J22");
frame = slide.getShapes().addOleObjectFrame(20, 20, 200, 70, "Excel.Sheet.12", excelFileName);
frame.setLinkPathLong(frame.getLinkPathLong() + getAddressOnWorksheet(cellRange));
frame.getSubstitutePictureFormat().getPicture().getImage().replaceImage(createOleImage(cellRange));
frame.setUpdateAutomatic(false);

cellRange = workbook.getWorksheets().get("sheet1").getCells().createRange("C26:E31");
frame = slide.getShapes().addOleObjectFrame(420, 300, 200, 70, "Excel.Sheet.12", excelFileName);
frame.setLinkPathLong(frame.getLinkPathLong() + getAddressOnWorksheet(cellRange));
frame.getSubstitutePictureFormat().getPicture().getImage().replaceImage(createOleImage(cellRange));
frame.setUpdateAutomatic(false);

presentation.save("output.pptx", SaveFormat.Pptx);
presentation.dispose();
static String getAddressOnWorksheet(Range cellRange)
{
    String worksheetName = "sheet1";
    return "!"+worksheetName+"!R"+(cellRange.getFirstRow() + 1)+ "C" + (cellRange.getFirstColumn() + 1) +
            ":R"+(cellRange.getFirstRow() + cellRange.getRowCount())+"C" + (cellRange.getColumnCount() + cellRange.getFirstColumn());
}

static byte[] createOleImage(com.aspose.cells.Range cellRange) throws Exception
{
    PageSetup pageSetup = cellRange.getWorksheet().getPageSetup();
    pageSetup.setPrintArea(cellRange.getAddress());
    pageSetup.setLeftMargin(0);
    pageSetup.setRightMargin(0);
    pageSetup.setTopMargin(0);
    pageSetup.setBottomMargin(0);
    pageSetup.clearHeaderFooter();

    ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
    ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();
    imageOrPrintOptions.setOnePagePerSheet(true);
    imageOrPrintOptions.setOnlyArea(true);
    imageOrPrintOptions.setImageType(com.aspose.cells.ImageType.EMF);

    SheetRender sheetRender = new SheetRender(cellRange.getWorksheet(),
            imageOrPrintOptions);
    sheetRender.toImage(0, imageStream);

    return imageStream.toByteArray();
}

However, we want to point out that the issue with the OLE shape size changing when updating links is still present. Unfortunately, there is nothing we can do on our end at this time, as this is an OLE object linking issue between PowerPoint and Excel.

Manage OLE|Aspose.Slides Documentation
Object Preview Issue when Adding OleObjectFrame|Aspose.Slides Documentation

Hi Andrey

Thanks for sharing the code.
I tried this approach but the tables and text on the presentation are images, not OLE objects.
We need on the data on the presentation to change when the excel changes.

I am able to do this with a single table using :

slide.shapes.add_ole_object_frame(
        50, 50, 500, 300,  # x, y, width, height
        "Excel.Sheet.12",  # ProgID for Excel
        excel_file_path    # Path to the linked Excel file
    )

But this approach only works when the table starts at cell A1 of the Excel file.

We will also prefer embedded(not linked) excels for all the tables and text with OLE objects on the presentation. Incase embedded is not an option, we can also work with a linked excel.

Thanks
Sukriti

@sukritisehgal,

When you manually add an OLE object to a PowerPoint presentation, an image of the object is automatically created and displayed on the slide (provided that the icon option is not selected for the object). Aspose.Slides offers the same capability.

The code example above demonstrates how to specify the cell range for the OLE object data.

This article shows how to add OLE objects with embedded Excel files.

Please let us know if you have any difficulties with this, and describe the issue in greater detail.

Hi Andrey,

I understand. This is exactly what I am looking to do programmatically. But the code you shared above, adds the tables as images not OLE objects.
To clarify, if I add an OLE object in PowerPoint, you are correct that it creates and displays an image of the object. But if I change the underlying Excel data, the image gets refreshed.
This refreshing capability is not working in the code you have shared above. The images on the presentation are static images.

Yes, I am following the same approach. This lets me create an embedded excel for the OLE objects. But it shows the entire excel sheet as an image instead of just 1 table, G2: M12. I tried using the createRange function similar to your code, but it is still displaying the entire excel sheet.

Can you please help to share another code example, that adds the OLE objects to the PPT with a refresh capability. Similar to pasting using Ctrl + Alt+ V manually → paste Link manually.
The requirement is that even though it is an image it should refresh when the underlying data changes.

Happy to get on a call to discuss this further.
This is very important for us.

@sukritisehgal,
We provide free support exclusively on this forum. We apologize for any inconvenience caused. I need some time to check the issue. I will get back to you as soon as possible.