Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:32:22+00:00 2026-06-12T10:32:22+00:00

I am basically creating a xlsx file but I am getting an error while

  • 0

I am basically creating a xlsx file but I am getting an error while using that file like below.

System.IO.FileFormatException: Archive file cannot be size 0.

The way I tried.

string file = "c:\\DoneDone61.xlsx";

using(File.Create(file))
{

}

Also I cannot open excel file manually because it says the file is corrupted.

Thanks for answers in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:32:23+00:00Added an answer on June 12, 2026 at 10:32 am

    An Excel file which you consider to be “blank” is not just a file with no data in it (which is what you are creating). You can see this yourself by creating a document manually in Excel and then opening it in notepad. You’ll notice that it actually has data inside of it. That data is used to store information regarding the three empty sheets named “Sheet1”, “Sheet2” and “Sheet3”. Also, there is some header information so that any program looking at the file knows that it is actually a compressed file (as per the Excel file format). So, as you can see, even a pretty empty excel file still contains SOME data.

    If you want to create a blank excel document using C#, you have two good options:

    1. Use a library that allows you to actually work with creating Excel documents that takes care of creating the file correctly. Check out something like the Microsoft OpenXML SDK or ExcelPackage.
    2. Create an empty Excel document, store it somewhere, and when you want to “create” a new empty Excel document, just make a copy of this file.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically im creating a GUI that allows the user to select a file,
So basically I'm creating wordpress themes for Themeforest, and I would like to get
I just need help. Basically I am creating a windows appllication that sends bulk
Basically, I am creating an XML file by taking the values from a column
I am creating an application that basically places a drawable into an imageView onClick.
So i have been creating this framework thing that basically puts together source code
I am basically creating an API in php, and one of the parameters that
I'm basically creating a display-module for an ad-system I've created. I'm trying to avoid
I am basically creating an iphone app that get's it's data from wordpress. Wordpress
I am basically creating a list of items that are generated at runtime. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.