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