Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
getting this error while generating xlsx file in c#
posted
Can not access a closed Stream.
System.ObjectDisposedException: Can not access a closed Stream.
   at System.IO.Compression.DeflateStream.EnsureNotDisposed()
   at MS.Internal.IO.Packaging.CompressStream.Flush()
   at MS.Internal.IO.Zip.ZipIOLocalFileBlock.FlushExposedStreams()
   at MS.Internal.IO.Zip.ZipIOLocalFileBlock.UpdateReferences(Boolean closingFlag)
   at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)
   at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)
   at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at System.IO.Packaging.PackagePart.Close()
   at System.IO.Packaging.Package.DoClose(PackagePart p)
   at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)
   at System.IO.Packaging.Package.System.IDisposable.Dispose()
   at Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.Dispose(Boolean disposing)
   at Infragistics.Documents.Excel.Serialization.WorkbookSaveManagerExcel2007.Dispose(Boolean disposing)
   at Infragistics.Documents.Excel.Workbook.SaveXLSXFileHelper(Stream stream, WorkbookSaveOptions saveOptions)
   at Infragistics.Documents.Excel.Workbook.Save(String fileName, WorkbookSaveOptions saveOptions)

Top Replies

Parents
No Data
Reply
  • 0
    Offline posted

    "Getting errors while generating an XLSX file in C# can be frustrating. Make sure to check your code for any issues with data types or the libraries you’re using. Sometimes, incorrect formatting can lead to these errors. If you need a break from troubleshooting, treating yourself to something sweet can help clear your mind. I love checking out the Dairy Queen Menu for a quick snack while I work through coding challenges. Good luck with your XLSX generation!"

Children
No Data