excel to PowerPoint

Convert Excel to PowerPoint in Java

The Excel workbooks are commonly used for financial data storage, analysis, and reporting purposes. Furthermore, we can use it for financial analysis, organizing data, time tracking etc. However, we may have a requirement to present excel data, so one of the viable solution is to directly convert Excel to PowerPoint format. In this article, we are going to discuss the details on how to implement excel to powerpoint automation.

Excel to Powerpoint Conversion API

We are going to use Aspose.Cells Cloud SDK for Java to perform the Excel to PowerPoint conversion. This API enables you to create, edit, convert Excel to PDF, Excel to JPG, Excel to HTML, and other Supported File Formats. Now the first important step is to add its binaries within maven build type project. So please add the following details in pom.xml file.

<repositories>
    <repository>
        <id>AsposeJavaAPI</id>
        <name>Aspose Java API</name>
        <url>https://repository.aspose.cloud/repo/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-cells-cloud</artifactId>
        <version>22.8</version>
    </dependency>
</dependencies>

In case you haven’t subscribed over Aspose Cloud, please create a free account through subscription process. Now lookup/create Client ID and Client Secret at Cloud Dashboard.

Convert Excel to PowerPoint in Java

This section shares the details on how to convert Excel to PowerPoint using Java code snippet. We are going to upload the file from local drive to cloud storage, perform Excel to PowerPoint conversion (all the worksheets) and save the output in cloud storage.

  • Create an instance of CellsApi while providing client credentials as input arguments
  • Specify the name of input Excel, resultant format as HTML, and output file name
  • Read Excel file from local storage through File instance
  • Upload the Excel worksheet to cloud storage using uploadFile(…) method
  • Finally, call the method cellsWorkbookGetWorkbook(…) for Excel to Powerpoint conversion
excel to PPTX preview

Image1:- Excel to PowerPoint Conversion preview

You may consider downloading the input Excel workbook used in above example from myDocument.xlsx and resultant PowerPoint from Resultant.pptx

Inserting Excel into PowerPoint using cURL Commands

Since REST APIs can easily be accessed via cURL commands, so in this section, we are going to convert Excel to PowerPoint using cURL commands. Now the first step is to generate a JWT access token while executing the following command.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Now that we have our personalized JWT token, we need to execute the following command to load an Excel from cloud storage and perform excel slides conversion operation. The resultant PowerPoint is stored in cloud storage.

curl -v -X GET "https://api.aspose.cloud/v3.0/cells/input.xlsx?format=PPTX&isAutoFit=true&onlySaveTable=true&outPath=Resultant.pptx&checkExcelRestriction=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>"

Conclusion

In this article, we have learned the details on how to convert Excel to PowerPoint using Java code snippets. At the same time, we have also leared excel slides conversion using cURL Commands. Please note that as our SDKs are built under an MIT license, so the complete source code can be downloaded from GitHub. In case you encounter any issues while using the APIs, please feel free to contact us via the product support forum.

We highly recommend visiting the following links to learn more about: