How to Split Excel Email Attachments into New Workbooks using Power Automate

Cloudmersive
4 min read2 days ago

--

Excel workbooks typically contain a number of different worksheets with important data, graphs, and other information. Separating each worksheet into its own independent workbook can make reviewing and processing Excel content easier.

Split Excel into New Workbooks via Power Automate

Using Power Automate, we can split Excel files into a series of separate workbooks and store those workbooks alongside one another in a SharePoint folder. This will result in each worksheet from the original Excel workbook living on its own — but with the same name it held in the original workbook.

We can build this flow for Excel files currently living in our system, as we’ve demonstrated in a prior article, or we can automate this conversion with Excel content sent to us via email.

Automate Excel Splitting Directly from Email Attachments

We can automate this conversion with Excel email attachments in a few quick & easy steps using the When a new email arrives (V3) trigger action from the Office 365 Outlook connector in a new Automated cloud flow.

We can start by asking our trigger action to check for emails from a specific sender & with attachments.

We can then use a Condition control to check if the Attachments Name value from our trigger action contains the “.xlsx” file extension. Email attachments without this extension won’t continue our flow.

After we select the Attachments Name value, Power Automate will place our Condition in a For each control to loop through each attachment name.

In the True branch of our condition, we can now add our Excel splitting action. We’ll find this action by first locating the Cloudmersive Document Conversion connector in Power Automate.

The specific action we’re looking for is called Split a single Excel XLSX into Separate Worksheets.

After we create our connection (this requires a free API key, which we can get by creating a free account on the Cloudmersive website), we can pass the Attachments Content and Attachments Name values as arguments into each of our two primary request parameters.

After that, we can navigate down to the Advanced parameters and select Yes to return the contents of each worksheet to our flow directly (this stands in contrast to returning each worksheet as a temporary URL and downloading them later).

We can now write each worksheet to a new Excel workbook using the Create file action from the SharePoint connector.

We can use the WorksheetName value from our Split Excel action to name each new workbook, and we can use the WorksheetContent value to set the new workbook contents.

We can then test our flow manually by sending ourselves an email with an Excel workbook attachment.

When our flow finishes running, we’ll find one new workbook in our target SharePoint folder for each worksheet in our original Excel document.

Just like that, we’ve created a simple 4-step flow that splits Excel files into a series of new workbooks when they’re sent to us from a specific sender.

Conclusion

In this article, we learned how to split Excel email attachments directly into a series of separate workbooks and save those new workbooks in a SharePoint folder. Our flow only took 4 steps, and we leveraged the Cloudmersive Document Conversion connector to handle our key Excel-splitting action.

Don’t forget to check back in on our blog for more Power Automate walkthroughs!

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet