System.OutOfMemoryException when writing large Excel file #1952
                  
                    
                      sw-ms-hardiksenghani
                    
                  
                
                  started this conversation in
                General
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Environment:
OpenXmlWriter(Package:3.3.0)
.NET Version: .Net Core 8
Operating System: Windows 10
Issue Summary:
We are generating an Excel file with approximately:
180 columns
500,000 rows
Cell formatting applied throughout
While writing data using OpenXmlWriter, the process fails after approximately 350,000 rows with the following exception:
Exception in Stream was too long.
Exception of type 'System.OutOfMemoryException' was thrown.
Steps to Reproduce:
Create a workbook and worksheet.
Populate 180 columns with formatted data.
Loop through and write 500,000 rows.
Save the workbook.
Expected Behavior: The Excel file should be generated successfully without memory issues.
Beta Was this translation helpful? Give feedback.
All reactions