rei0429 wrote:
TryThe issue is not the BinaryWrite command. The issue is the default logic in the NPOI library to close the stream after completing the write command in the XSSFWorkbook. Based on other posts this is the chosen functionality for the NPOI library but it only applies to XSSF and not HSSF. The same issue does not apply to the EPPlus 4.0.4 library when it writes XLSX so I believe this is a coding mistake. The stream being written needs to stay open.
BinaryWrite(MyMemory.ToArray())