Skip to content

Infragistics Community Forum / Web / Ignite UI for ASP.NET Core / getting this error while generating xlsx file in c#

getting this error while generating xlsx file in c#

New Discussion
Rajesh Rathva
Rajesh Rathva asked on Oct 2, 2025 9:44 AM
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)
Sign In to post a reply

Replies

  • 0
    Michael DiFilippo
    Michael DiFilippo answered on Apr 28, 2023 5:26 PM

    Hello Rajesh, 

    Thank you for contacting Infragistics. Please attach a sample project demonstrating the behavior. 

  • 0
    Luis Mallet
    Luis Mallet answered on May 26, 2023 7:07 AM

    Have you resolved it? Or do you still need help?

  • 0
    Cheryl Bassett
    Cheryl Bassett answered on Jun 12, 2023 6:46 AM

    Any update?

  • 0
    Peggy Showman
    Peggy Showman answered on Jun 13, 2023 11:10 AM

    One of the best things about grow tents is their portability. You can easily set them up and move them around if needed, making them ideal for renters or people with limited space. best 5×5 grow tent

  • 0
    Rachel  Mark
    Rachel Mark answered on Sep 7, 2023 7:43 AM

    How did you resolve the issue?
    chemical manufacturer

  • 0
    Nelly Aurora
    Nelly Aurora answered on Oct 6, 2023 2:12 AM

    I find myself in the same situation. Have you resolved it problem heardle 80s?

    • 0
      Kabir Singh
      Kabir Singh answered on Nov 9, 2023 5:39 AM

      You are safe with us and our Delhi Escort and no matter any number of times you avail our services, you are in safest zone committed completely to please you. We also value your hard earned funds and consequently have deliberately have marked cheap services despite of high degree of excellence and high profile services

      • 0
        Demian Murano
        Demian Murano answered on Jun 16, 2025 6:42 AM

        If you’ve been hesitant to try, trust me — these ilford escorts are the real deal. Classy, confident, and full of energy. It was everything I was hoping for and more.

  • 0
    Waleed sattar
    Waleed sattar answered on Nov 28, 2023 7:19 AM

    Consider selling digital products such as e-books, online courses, or digital art. The demand for digital content continues to rise, and creating a platform to distribute valuable knowledge or creative content can be a lucrative venture.

    this content

    have a peek at these guys

    check my blog

    • 0
      stirsizzle Customer
      stirsizzle Customer answered on Dec 21, 2023 1:14 PM

      Stir&Sizzle specialize in Desi food, Indian food and affordable catering that doesn't compromise on quality that has helped us to attain above 90% customer satisfaction rate. Experience the difference with Stir&Sizzle – your go-to for affordable, best-in-class catering near you, including full-service catering, catering delivery services, and cheap catering for weddings, Birthday parties, Festival celebrations, Conferences, and Seminars to make your day special.

      <a href="">stirsizzle.com/…/a>

  • 0
    Geesmart Noufal Geesmart
    Geesmart Noufal Geesmart answered on Jul 2, 2024 5:20 AM

    any update

  • 0
    Jo tase
    Jo tase answered on Sep 10, 2024 7:49 PM

    If you're wondering how to make a cookbook on Canva, the process is simple and straightforward. Start by selecting a template that fits your vision, then customize it by adding your recipes, images, and any personal touches. You can arrange your content by chapters or themes, and Canva’s drag-and-drop functionality makes it easy to format your cookbook. Once you're happy with the result, you can download the book in various formats or even order printed copies directly from Canva.

  • 0
    Robyn G. Knapp
    Robyn G. Knapp answered on Sep 11, 2024 6:34 PM

    When preparing for a skills test, the temptation to cram might be strong, especially if you’re short on time. But why shouldn’t you cram for a skills test? Unlike exams that require memorization, skills tests often assess your ability to apply knowledge in practical situations. Cramming may help you remember facts temporarily, but it doesn’t equip you with the proficiency needed to perform well on a skills test.

  • 0
    Alexander Ezra
    Alexander Ezra answered on Oct 12, 2024 1:46 PM

    "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!"

  • 0
    Jo tase
    Jo tase answered on Feb 7, 2025 8:54 PM

    Many students search for the most common MCQ answer when unsure about a question. While some test patterns may show a slight preference for certain answers, the key to success in multiple-choice exams is understanding the subject matter, identifying keywords, and eliminating distractors. Instead of randomly choosing an option, students should develop strong analytical skills to make informed guesses. StudyRight provides effective methods for mastering MCQ exams beyond simple guessing.

  • 0
    Jo tase
    Jo tase answered on Feb 7, 2025 9:34 PM

    Learning how to make a cookbook on Canva is a game-changer for food bloggers who want to monetize their content or offer free recipe books to their audience. With Canva’s user-friendly interface, bloggers can easily drag and drop images, customize fonts and colors, and create an eye-catching layout. KitchenBloggers provides step-by-step guidance on how to create an attractive and functional cookbook that can be shared digitally or printed for distribution.

  • 0
    Carl Bidwell
    Carl Bidwell answered on Oct 2, 2025 9:44 AM

    That error usually means the file stream is getting closed before the workbook finishes saving. Try wrapping the save in a using (var stream = new FileStream(...)) { ... } block so it only disposes after the save is complete. Infragistics community

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Rajesh Rathva
Favorites
0
Replies
17
Created On
Oct 02, 2025
Last Post
4 months, 3 weeks ago

Suggested Discussions

Created by

Created on

Oct 2, 2025 9:44 AM

Last activity on

Oct 2, 2025 9:44 AM