Fix Power Automate Desktop Excel Write Failed with OutOfMemoryException
Question details
The user needs to resolve an OutOfMemoryException that occurs when writing a large data table parsed from JSON into Excel via Power Automate Desktop.

- Product
- Power Automate Desktop / Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating the extraction of JSON data and writing the resulting data table into an Excel spreadsheet using a desktop flow.
- Observed behavior
- The flow successfully parses the JSON but fails during the Excel write action, throwing a System.OutOfMemoryException (error code 0x8007000E), even though system RAM is sufficient and writing to CSV works perfectly.
Ensure you have saved a backup of your original JSON files and try temporarily closing background memory-heavy applications to free up available system resources for the COM objects.
Use the Write to CSV File Action
Bypass the memory constraints of Excel's COM interface by writing your extracted data table directly to a CSV file.
Excel actions in Power Automate Desktop rely on COM objects, which have strict memory limits regardless of your physical RAM. Writing directly to a CSV text file requires significantly less memory and prevents the OutOfMemoryException.
In your Power Automate Desktop flow, locate and delete the existing 'Write to Excel worksheet' action that is causing the error.
Search for the 'Write to CSV file' action in the actions pane and drag it into your flow.
Set the 'Variable to write' to the data table variable produced by your parsed JSON. Choose your preferred file path and save the action.
Execute the flow to generate the CSV file. You can later open this file and natively save it as an .xlsx workbook.

Switch to a Power Automate Cloud Flow
Utilize a cloud flow to handle highly complex or lengthy JSON files by leveraging cloud processing power instead of local desktop resources.
Truncate Data and Process in Smaller Batches
Reduce the memory footprint by stripping unnecessary properties and writing the data in smaller chunks.
Easily Convert Large CSV Exports to Excel with WPS Office
After successfully bypassing the Power Automate Desktop error by exporting your JSON to a CSV file, use WPS Spreadsheet to instantly open and save massive CSV outputs as native Excel workbooks without experiencing high memory usage or crashes.
- 1. Download and Install: Download and install the free WPS Office suite on your computer.
- 2. Open CSV File: Launch WPS Spreadsheet and open the CSV file successfully generated by your Power Automate Desktop flow.
- 3. Save as Excel Workbook: Click 'Menu', select 'Save As', choose 'Microsoft Excel Workbook (*.xlsx)' from the format dropdown, and save your new file.

Frequently Asked Questions
Why does Power Automate Desktop fail with OutOfMemoryException when writing to Excel?
This typically occurs because the Excel COM object utilized by Power Automate Desktop consumes excessive memory when receiving massive or highly complex data tables, eventually hitting an application memory limit even if your PC has available RAM.
Does error code 0x8007000E mean my computer needs more RAM?
Not necessarily. Error 0x8007000E indicates a memory allocation failure, which usually stems from the COM interface's software memory management constraints rather than a lack of physical system RAM.
Is there a file size limit for converting JSON to Excel in Power Automate?
While there isn't a strict documented file size limit, JSON strings that are excessively long or contain a vast number of nested properties can cause the internal conversion buffer in Power Automate Desktop to overflow.




