Chart.validateChartLayout Throws ArgumentOutOfRangeException in Java

Something bad is happening with attached presentation, it throws

class com.aspose.slides.exceptions.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Parameter name: index

on validateChartData() for third embedded excel. Please check!

Code:

@Test
    public void embedded() throws Exception {

        String path = "INPUT_validate_chart_error_on_excel_embeddings.pptx"; //$NON-NLS-1$

        com.aspose.slides.Presentation presentation;

        try (InputStream testStream = new FileInputStream(path)) {
            presentation = new com.aspose.slides.Presentation(testStream);
        }

        com.aspose.slides.ISlideCollection slides = presentation.getSlides();

        for (com.aspose.slides.ISlide slide : slides) {
            com.aspose.slides.IShapeCollection shapes = slide.getShapes();

            for (com.aspose.slides.IShape shape : shapes) {
                if ((shape instanceof com.aspose.slides.IChart)) {
                    IChart chart = (com.aspose.slides.IChart) shape;

                    byte[] bytes = null;
                    try {
                        bytes = chart.getChartData().readWorkbookStream();
                    } catch (InvalidOperationException ioe) {
                        System.err.println("Not accessible chart data");

//                        continue;
                    }

                    if (bytes != null) {
                        try (InputStream excelStream = new ByteArrayInputStream(bytes)) {
                            com.aspose.cells.Workbook workbook = new com.aspose.cells.Workbook(excelStream);

                            com.aspose.cells.WorksheetCollection worksheets = workbook.getWorksheets();

                            for (com.aspose.cells.Worksheet worksheet : worksheets) {
                                com.aspose.cells.Cells cells = worksheet.getCells();

                                int maxRowIndex = cells.getMaxRow();
                                int maxColumnIndex = cells.getMaxColumn();

                                for (int i = 0; i <= maxRowIndex; i++) {
                                    for (int j = 0; j <= maxColumnIndex; j++) {
                                        com.aspose.cells.Cell cell = cells.get(i, j);

                                        if (!cell.isFormula() && !cell.isArrayFormula()) {
                                            Object value = cell.getValue();

                                            if (value instanceof String && cell.getStyle() != null && !cell.getStyle().isPercent()) {
                                                cell.setValue("Z_" + value);
                                            }
                                        }
                                    }
                                }

                                for (com.aspose.cells.Chart chart1 : worksheet.getCharts()) {

                                    com.aspose.cells.Title chartTitle = chart1.getTitle();
                                    chartTitle.setText("Z_" + chartTitle.getText());

                                    com.aspose.cells.Title chartXAxisTitle = chart1.getCategoryAxis().getTitle();
                                    chartXAxisTitle.setText("Z_" + chartXAxisTitle.getText());

                                    // handle secondary x-axis title if exists
                                    com.aspose.cells.Title chartSecondXAxisTitle = chart1.getSecondCategoryAxis().getTitle();
                                    if (chartSecondXAxisTitle.getText() != null) {
                                        chartSecondXAxisTitle.setText("Z_" + chartSecondXAxisTitle.getText());
                                    }

                                    com.aspose.cells.Title chartYAxisTitle = chart1.getValueAxis().getTitle();
                                    chartYAxisTitle.setText("Z_" + chartYAxisTitle.getText());

                                    // handle secondary y-axis title if exists
                                    com.aspose.cells.Title chartSecondYAxisTitle = chart1.getSecondValueAxis().getTitle();
                                    if (chartSecondYAxisTitle.getText() != null) {
                                        chartSecondYAxisTitle.setText("Z_" + chartSecondYAxisTitle.getText());
                                    }

                                    // handle z-axis (depth axis) if chart is 3D
                                    com.aspose.cells.Title chartZAxisTitle = chart1.getSeriesAxis().getTitle();
                                    if (chart1.getIs3D()) {
                                        chartZAxisTitle.setText("Z_" + chartZAxisTitle.getText());
                                    }

                                    chart1.calculate();
                                }
                            }

                            workbook.calculateFormula();

                            ByteArrayOutputStream baos = new ByteArrayOutputStream();

                            workbook.save(baos, com.aspose.cells.SaveFormat.XLSX);

                            baos.flush();

                            chart.getChartData().writeWorkbookStream(baos.toByteArray());

                        } catch (Exception e) {
                            throw new RuntimeException(e);
                        }


                    }

                    com.aspose.slides.ITextFrame textFrame = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding();
                    if (textFrame != null) {
                        textFrame.setText("Z_" + textFrame.getText());
                    }
                    com.aspose.slides.IAxis secondary = chart.getAxes().getSecondaryVerticalAxis();
                    if (secondary != null) {
                        textFrame = secondary.getTitle().getTextFrameForOverriding();
                        if (textFrame != null) {
                            textFrame.setText("Z_" + textFrame.getText());
                        }
                    }
                    textFrame = chart.getChartTitle().getTextFrameForOverriding();
                    if (textFrame != null) {
                        textFrame.setText("Z_" + textFrame.getText());
                    }

                    textFrame = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding();
                    if (textFrame != null) {
                        textFrame.setText("Z_" + textFrame.getText());
                    }

                    secondary = chart.getAxes().getSecondaryHorizontalAxis();
                    if (secondary != null) {
                        textFrame = chart.getAxes().getSecondaryHorizontalAxis().getTitle().getTextFrameForOverriding();
                        if (textFrame != null) {
                            textFrame.setText("Z_" + textFrame.getText());
                        }
                    }

                    for (com.aspose.slides.IShape uShape : chart.getUserShapes().getShapes()) {
                        if (uShape instanceof com.aspose.slides.IAutoShape) {
                            ((com.aspose.slides.IAutoShape) uShape).getTextFrame()
                                    .setText("Z_" + ((com.aspose.slides.IAutoShape) uShape).getTextFrame().getText());
                        } else if (uShape instanceof com.aspose.slides.GroupShape) {
                            for (com.aspose.slides.IShape uGroupSHape : ((com.aspose.slides.GroupShape) uShape).getShapes()) {
                                // needs refactoring :)
                                if (uGroupSHape instanceof com.aspose.slides.IAutoShape) {
                                    ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame()
                                            .setText("Z_" + ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame().getText());
                                }
                            }
                        } else if (uShape instanceof com.aspose.slides.ITable) {
                            // needs refactoring 2 :(
                            ((com.aspose.slides.ITable) uShape).getColumns()
                                    .forEach(x -> x
                                            .forEach(y -> y
                                                    .getTextFrame()
                                                    .setText("Z_" + y
                                                            .getTextFrame()
                                                            .getText())));
                        } else if (uShape instanceof com.aspose.slides.ISmartArt) {
                            for(com.aspose.slides.ISmartArtNode smartArtNode: ((com.aspose.slides.ISmartArt) uShape).getAllNodes()) {
                                smartArtNode.getTextFrame().setText("Z_" + smartArtNode.getTextFrame().getText());
                            }
                        }
                    }

                    chart.validateChartLayout();

                    try {
                        com.aspose.slides.IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook();
                        chart.validateChartLayout();
                        System.err.println("validate NonE-xtracted");
//            }
                    } catch (com.aspose.slides.exceptions.InvalidOperationException e) {
                        String extPath = chart.getChartData().getExternalWorkbookPath();
                        System.out.println("Slide chart skipped (external): " + extPath);
                    }
                } else if (shape instanceof com.aspose.slides.IAutoShape) {
                    ((com.aspose.slides.IAutoShape) shape).getTextFrame()
                            .setText("Z_" + ((com.aspose.slides.IAutoShape) shape).getTextFrame().getText());
                } else if (shape instanceof com.aspose.slides.GroupShape) {
                    for (com.aspose.slides.IShape uGroupSHape : ((com.aspose.slides.GroupShape) shape).getShapes()) {
                        // needs refactoring :)
                        if (uGroupSHape instanceof com.aspose.slides.IAutoShape) {
                            ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame()
                                    .setText("Z_" + ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame().getText());
                        }
                    }
                } else if (shape instanceof com.aspose.slides.ITable) {
                    // needs refactoring 2 :(
                    ((com.aspose.slides.ITable) shape).getColumns()
                            .forEach(x -> x
                                    .forEach(y -> y
                                            .getTextFrame()
                                            .setText("Z_" + y
                                                    .getTextFrame()
                                                    .getText())));
                } else if (shape instanceof com.aspose.slides.ISmartArt) {
                    for(com.aspose.slides.ISmartArtNode smartArtNode: ((com.aspose.slides.ISmartArt) shape).getAllNodes()) {
                        smartArtNode.getTextFrame().setText("Z_" + smartArtNode.getTextFrame().getText());
                    }
                }
            }
        }

        File tmpSaveFile = Files.createTempFile("validate_chart_error_on_excel_embeddings", ".pptx").toFile();

        try (FileOutputStream fos = new FileOutputStream(tmpSaveFile)) {
            presentation.save(fos, SaveFormat.Pptx);
        }
    }

INPUT_validate_chart_error_on_excel_embeddings.pptx.zip (6.4 MB)

@zpredojevic,
Thank you for reporting the issue. I have reproduced the problem where the validateChartLayout method throws the ArgumentOutOfRangeException. We apologize for any inconvenience caused.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39843

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.

:frowning_face: Thank You!

@zpredojevic,
Thank you for helping make Aspose.Slides better.

@zpredojevic,
Could you please clarify what exactly you are trying to achieve by modifying and replacing the embedded workbook?

We investigated the exception further and found that it occurs because the entire workbook is replaced while the chart retains its existing series and category data. As a result, the chart data becomes inconsistent, and validateChartLayout() throws an ArgumentOutOfRangeException.

Please clear the existing chart series and categories before writing the modified workbook:

chartData.getSeries().clear();
chartData.getCategories().clear();

chartData.writeWorkbookStream(baos.toByteArray());

After clearing the old chart data, the exception should no longer occur.

See also:
Manage Chart Workbooks in Presentations Using Java|Aspose.Slides Documentation

Thank you Andrey.

Getting back to this one a bit late, sorry.
Take a look at my email and guess what I am trying to achieve :slight_smile:

I’ve tried this, and exception is no longer thrown. However, the new excel data is not visible at all with this approach. What else I can do?

validate_chart_error_on_excel_embeddings.zip (6.0 MB)

Best regards,
Zeljko

@zpredojevic,
Thank you for the sample presentation file. Could you please share the complete code example to reproduce the issue you mentioned?

@Test
    public void embedded() throws Exception {

        String path = "INPUT_validate_chart_error_on_excel_embeddings.pptx"; //$NON-NLS-1$

        com.aspose.slides.Presentation presentation;

        try (InputStream testStream = new FileInputStream(path)) {
            presentation = new com.aspose.slides.Presentation(testStream);
        }

        com.aspose.slides.ISlideCollection slides = presentation.getSlides();

        for (com.aspose.slides.ISlide slide : slides) {
            com.aspose.slides.IShapeCollection shapes = slide.getShapes();

            for (com.aspose.slides.IShape shape : shapes) {
                if ((shape instanceof com.aspose.slides.IChart)) {
                    IChart chart = (com.aspose.slides.IChart) shape;

                    byte[] bytes = null;
                    try {
                        bytes = chart.getChartData().readWorkbookStream();
                    } catch (InvalidOperationException ioe) {
                        System.err.println("Not accessible chart data");

//                        continue;
                    }

                    if (bytes != null) {
                        try (InputStream excelStream = new ByteArrayInputStream(bytes)) {
                            com.aspose.cells.Workbook workbook = new com.aspose.cells.Workbook(excelStream);

                            com.aspose.cells.WorksheetCollection worksheets = workbook.getWorksheets();

                            for (com.aspose.cells.Worksheet worksheet : worksheets) {
                                com.aspose.cells.Cells cells = worksheet.getCells();

                                int maxRowIndex = cells.getMaxRow();
                                int maxColumnIndex = cells.getMaxColumn();

                                for (int i = 0; i <= maxRowIndex; i++) {
                                    for (int j = 0; j <= maxColumnIndex; j++) {
                                        com.aspose.cells.Cell cell = cells.get(i, j);

                                        if (!cell.isFormula() && !cell.isArrayFormula()) {
                                            Object value = cell.getValue();

                                            if (value instanceof String && cell.getStyle() != null && !cell.getStyle().isPercent()) {
                                                cell.setValue("Z_" + value);
                                            }
                                        }
                                    }
                                }

                                for (com.aspose.cells.Chart chart1 : worksheet.getCharts()) {

                                    com.aspose.cells.Title chartTitle = chart1.getTitle();
                                    chartTitle.setText("Z_" + chartTitle.getText());

                                    com.aspose.cells.Title chartXAxisTitle = chart1.getCategoryAxis().getTitle();
                                    chartXAxisTitle.setText("Z_" + chartXAxisTitle.getText());

                                    // handle secondary x-axis title if exists
                                    com.aspose.cells.Title chartSecondXAxisTitle = chart1.getSecondCategoryAxis().getTitle();
                                    if (chartSecondXAxisTitle.getText() != null) {
                                        chartSecondXAxisTitle.setText("Z_" + chartSecondXAxisTitle.getText());
                                    }

                                    com.aspose.cells.Title chartYAxisTitle = chart1.getValueAxis().getTitle();
                                    chartYAxisTitle.setText("Z_" + chartYAxisTitle.getText());

                                    // handle secondary y-axis title if exists
                                    com.aspose.cells.Title chartSecondYAxisTitle = chart1.getSecondValueAxis().getTitle();
                                    if (chartSecondYAxisTitle.getText() != null) {
                                        chartSecondYAxisTitle.setText("Z_" + chartSecondYAxisTitle.getText());
                                    }

                                    // handle z-axis (depth axis) if chart is 3D
                                    com.aspose.cells.Title chartZAxisTitle = chart1.getSeriesAxis().getTitle();
                                    if (chart1.getIs3D()) {
                                        chartZAxisTitle.setText("Z_" + chartZAxisTitle.getText());
                                    }

                                    chart1.calculate();
                                }
                            }

                            workbook.calculateFormula();

                            ByteArrayOutputStream baos = new ByteArrayOutputStream();

                            workbook.save(baos, com.aspose.cells.SaveFormat.XLSX);

                            baos.flush();

                            chart.getChartData().getSeries().clear();
                            chart.getChartData().getCategories().clear();

                            chart.getChartData().writeWorkbookStream(baos.toByteArray());

                        } catch (Exception e) {
                            throw new RuntimeException(e);
                        }


                    }

                    com.aspose.slides.ITextFrame textFrame = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding();
                    if (textFrame != null) {
                        textFrame.setText("Z_" + textFrame.getText());
                    }
                    com.aspose.slides.IAxis secondary = chart.getAxes().getSecondaryVerticalAxis();
                    if (secondary != null) {
                        textFrame = secondary.getTitle().getTextFrameForOverriding();
                        if (textFrame != null) {
                            textFrame.setText("Z_" + textFrame.getText());
                        }
                    }
                    textFrame = chart.getChartTitle().getTextFrameForOverriding();
                    if (textFrame != null) {
                        textFrame.setText("Z_" + textFrame.getText());
                    }

                    textFrame = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding();
                    if (textFrame != null) {
                        textFrame.setText("Z_" + textFrame.getText());
                    }

                    secondary = chart.getAxes().getSecondaryHorizontalAxis();
                    if (secondary != null) {
                        textFrame = chart.getAxes().getSecondaryHorizontalAxis().getTitle().getTextFrameForOverriding();
                        if (textFrame != null) {
                            textFrame.setText("Z_" + textFrame.getText());
                        }
                    }

                    for (com.aspose.slides.IShape uShape : chart.getUserShapes().getShapes()) {
                        if (uShape instanceof com.aspose.slides.IAutoShape) {
                            ((com.aspose.slides.IAutoShape) uShape).getTextFrame()
                                    .setText("Z_" + ((com.aspose.slides.IAutoShape) uShape).getTextFrame().getText());
                        } else if (uShape instanceof com.aspose.slides.GroupShape) {
                            for (com.aspose.slides.IShape uGroupSHape : ((com.aspose.slides.GroupShape) uShape).getShapes()) {
                                // needs refactoring :)
                                if (uGroupSHape instanceof com.aspose.slides.IAutoShape) {
                                    ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame()
                                            .setText("Z_" + ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame().getText());
                                }
                            }
                        } else if (uShape instanceof com.aspose.slides.ITable) {
                            // needs refactoring 2 :(
                            ((com.aspose.slides.ITable) uShape).getColumns()
                                    .forEach(x -> x
                                            .forEach(y -> y
                                                    .getTextFrame()
                                                    .setText("Z_" + y
                                                            .getTextFrame()
                                                            .getText())));
                        } else if (uShape instanceof com.aspose.slides.ISmartArt) {
                            for(com.aspose.slides.ISmartArtNode smartArtNode: ((com.aspose.slides.ISmartArt) uShape).getAllNodes()) {
                                smartArtNode.getTextFrame().setText("Z_" + smartArtNode.getTextFrame().getText());
                            }
                        }
                    }

                    chart.validateChartLayout();

                    try {
                        com.aspose.slides.IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook();
                        chart.validateChartLayout();
                        System.err.println("validate NonE-xtracted");
//            }
                    } catch (com.aspose.slides.exceptions.InvalidOperationException e) {
                        String extPath = chart.getChartData().getExternalWorkbookPath();
                        System.out.println("Slide chart skipped (external): " + extPath);
                    }
                } else if (shape instanceof com.aspose.slides.IAutoShape) {
                    ((com.aspose.slides.IAutoShape) shape).getTextFrame()
                            .setText("Z_" + ((com.aspose.slides.IAutoShape) shape).getTextFrame().getText());
                } else if (shape instanceof com.aspose.slides.GroupShape) {
                    for (com.aspose.slides.IShape uGroupSHape : ((com.aspose.slides.GroupShape) shape).getShapes()) {
                        // needs refactoring :)
                        if (uGroupSHape instanceof com.aspose.slides.IAutoShape) {
                            ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame()
                                    .setText("Z_" + ((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame().getText());
                        }
                    }
                } else if (shape instanceof com.aspose.slides.ITable) {
                    // needs refactoring 2 :(
                    ((com.aspose.slides.ITable) shape).getColumns()
                            .forEach(x -> x
                                    .forEach(y -> y
                                            .getTextFrame()
                                            .setText("Z_" + y
                                                    .getTextFrame()
                                                    .getText())));
                } else if (shape instanceof com.aspose.slides.ISmartArt) {
                    for(com.aspose.slides.ISmartArtNode smartArtNode: ((com.aspose.slides.ISmartArt) shape).getAllNodes()) {
                        smartArtNode.getTextFrame().setText("Z_" + smartArtNode.getTextFrame().getText());
                    }
                }
            }
        }

        File tmpSaveFile = Files.createTempFile("validate_chart_error_on_excel_embeddings", ".pptx").toFile();

        try (FileOutputStream fos = new FileOutputStream(tmpSaveFile)) {
            presentation.save(fos, SaveFormat.Pptx);
        }
    }

And here is the appropriate saved file, sorry about confusion!

validate_chart_error_on_excel_embeddings16952360528303447034.zip (5.9 MB)

@zpredojevic,
Thank you for the details. I need some time to investigate the case. I will get back to you as soon as possible.

@zpredojevic,
I have forwarded all the additional information you provided to our development team. We will continue investigating the issue and will let you know when we have any updates or further information.

Great, looking forward, thank you!

@zpredojevic,
Could you please describe what you are trying to accomplish with this code? Specifically, how do you plan to modify the chart data?

I am trying to pull from the file everything that can be considered as translatable, translate it, and put translation back into it’s appropriate place.

@zpredojevic,
Thank you for the additional information. I’ve forwarded it to our developers.

@zpredojevic,
Since the goal is to retrieve, process, and write back the text data, this greatly simplifies everything. We’ve prepared a code example that demonstrates how to extract and modify data from various elements on a slide. Please let us know whether this approach would be suitable for you.

String path = "1649444_Fidelity Global Small Cap Opportunities Fund FINAL_E.pptx"; //$NON-NLS-1$

com.aspose.slides.Presentation presentation;

try (InputStream testStream = new FileInputStream(path)) {
    presentation = new com.aspose.slides.Presentation(testStream);
}

com.aspose.slides.ISlideCollection slides = presentation.getSlides();

for (com.aspose.slides.ISlide slide : slides) {
    com.aspose.slides.IShapeCollection shapes = slide.getShapes();

    for (com.aspose.slides.IShape shape : shapes) {
        if ((shape instanceof com.aspose.slides.IChart)) {
            IChart chart = (com.aspose.slides.IChart) shape;

            for (IChartSeries series : chart.getChartData().getSeries())
            {
                if (series.getName().getDataSourceType() == DataSourceType.StringLiterals)
                {
                    String value = series.getName().getAsLiteralString();
                    series.getName().setAsLiteralString("Z_"+value);
                }
                if (series.getName().getDataSourceType() == DataSourceType.Worksheet)
                {
                    IChartCellCollection value = series.getName().getAsCells();
                    for (IChartDataCell cell : value)
                    {
                        if (cell.getValue() instanceof String) {
                            String v = (String)cell.getValue();
                            cell.setValue("Z_"+ v);
                        }
                    }
                }
                for(IDataLabel dataPoint : series.getLabels())
                {
                    if (dataPoint.getValueFromCell() != null && dataPoint.getValueFromCell().getValue() instanceof String)
                    {
                        String value = (String)dataPoint.getValueFromCell().getValue();

                        dataPoint.getValueFromCell().setValue("Z_" + value);
                    }
                }
            }

            for (IChartCategory category : chart.getChartData().getCategories())
            {
                if (category.getAsCell() != null && category.getAsCell().getValue() instanceof String)
                {
                    String value = (String)category.getAsCell().getValue();

                    category.getAsCell().setValue("Z_" + value);
                }
            }

            com.aspose.slides.ITextFrame textFrame = chart.getChartTitle().getTextFrameForOverriding();
            if (textFrame != null) {
                textFrame.setText("Z_" + textFrame.getText());
            }

            textFrame = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding();
            if (textFrame != null) {
                textFrame.setText("Z_" + textFrame.getText());
            }

            com.aspose.slides.IAxis secondary = chart.getAxes().getSecondaryHorizontalAxis();
            if (secondary != null) {
                textFrame = chart.getAxes().getSecondaryHorizontalAxis().getTitle().getTextFrameForOverriding();
                if (textFrame != null) {
                    textFrame.setText("Z_" + textFrame.getText());
                }
            }
            textFrame = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding();
            if (textFrame != null) {
                textFrame.setText("Z_" + textFrame.getText());
            }

            secondary = chart.getAxes().getSecondaryVerticalAxis();
            if (secondary != null) {
                textFrame = chart.getAxes().getSecondaryVerticalAxis().getTitle().getTextFrameForOverriding();
                if (textFrame != null) {
                    textFrame.setText("Z_" + textFrame.getText());
                }
            }

            for (com.aspose.slides.IShape uShape : chart.getUserShapes().getShapes()) {
                if (uShape instanceof com.aspose.slides.IAutoShape) {
                    replaceText(((com.aspose.slides.IAutoShape) uShape).getTextFrame());
                } else if (uShape instanceof com.aspose.slides.GroupShape) {
                    for (com.aspose.slides.IShape uGroupSHape : ((com.aspose.slides.GroupShape) uShape).getShapes()) {
                        if (uGroupSHape instanceof com.aspose.slides.IAutoShape) {
                            replaceText(((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame());
                        }
                    }
                } else if (uShape instanceof com.aspose.slides.ITable) {
                    ITable table = ((com.aspose.slides.ITable) shape);
                    for(IRow row : table.getRows())
                    {
                        for (int i = 0; i < row.size(); i++)
                        {
                            replaceText(row.get_Item(i).getTextFrame());
                        }
                    }
                } else if (uShape instanceof com.aspose.slides.ISmartArt) {
                    for(com.aspose.slides.ISmartArtNode smartArtNode: ((com.aspose.slides.ISmartArt) uShape).getAllNodes()) {
                        replaceText(smartArtNode.getTextFrame());
                    }
                }
            }

            chart.validateChartLayout();

        }
        else if (shape instanceof com.aspose.slides.IAutoShape) {
            replaceText(((com.aspose.slides.IAutoShape) shape).getTextFrame());
        } else if (shape instanceof com.aspose.slides.GroupShape) {
            for (com.aspose.slides.IShape uGroupSHape : ((com.aspose.slides.GroupShape) shape).getShapes()) {
                if (uGroupSHape instanceof com.aspose.slides.IAutoShape) {
                    replaceText(((com.aspose.slides.IAutoShape) uGroupSHape).getTextFrame());
                }
            }
        } else if (shape instanceof com.aspose.slides.ITable) {
            ITable table = ((com.aspose.slides.ITable) shape);
            for(IRow row : table.getRows())
            {
                for (int i = 0; i < row.size(); i++)
                {
                    replaceText(row.get_Item(i).getTextFrame());
                }
            }
        } else if (shape instanceof com.aspose.slides.ISmartArt) {
            for(com.aspose.slides.ISmartArtNode smartArtNode: ((com.aspose.slides.ISmartArt) shape).getAllNodes()) {
                replaceText(smartArtNode.getTextFrame());
            }
        }
    }
}

presentation.save("validate_chart_error_on_excel_embeddings.pptx", SaveFormat.Pptx);
private static void replaceText(ITextFrame textFrame) {
    for (IParagraph para: textFrame.getParagraphs())
    {
        for(IPortion port : para.getPortions())
        {
            if (!port.getText().isEmpty())
                port.setText("Z_" + port.getText());
        }
    }
}

Thank you, but this is not the way I need it to be. As I said in original thread, and as it is written in provided test code, I need to work with excel cells using com.aspose.cells.Cell, not using IChartDataCell. And not just cells, but anything that comes from excel file needs to go through Excel Aspose API.
Help? :frowning:

@zpredojevic,
Thank you for the additional information. We will continue investigating your requirements.

How is it going with this request?

Kind regards,
Zeljko

@zpredojevic,
Thank you for following up.

At the moment, this issue is blocked by a similar issue in Aspose.Slides for .NET that our development team is working on. Once the .NET issue is resolved, the corresponding issue in Aspose.Slides for Java should be resolved as well.

We will let you know as soon as there are any updates. Thank you for your patience.