How To Create a Password Protected Excel Using MuleSoft

Creating an excel output is quite common in MuleSoft. But sometime we need to assign a password protection to the excel sheet. In this post, I am going to explain how to achieve this in Mulesoft.

How to create excel file using MuleSoft

Table of Contents

What is the Problem?

MuleSoft provides a way to transform the output to css or excel but how to make an excel file password protected.


Remember to store sensitive information, we protect excel sheet. So how do we create a password protected file? There is no inbuilt option in MuleSoft. There are various ways but I am going to suggest using Java class to achieve this.

We are going to use Apache POI to access, create excel sheet and then protect it with a password.

We will create a Java class for it. Remember once you protect an excel file with password, you cannot get the original payload using MuleSoft without decrypting it back.

What is Apache POI

Apache POI, a project run by the Apache Software Foundation, and previously a sub-project of the Jakarta Project, provides pure Java libraries for reading and writing files in Microsoft Office formats, such as Word, PowerPoint and Excel

List Of Steps



Complete excel flow

Download Complete code from here

Bonus Tips

If you are using Cloudhub, you may use /tmp location to store unprotected file temporarily or if on premise, select folder path from local file system.

Please Share this post with your friends community.


Leave a Comment