title: Editing Excel Template with NPOI C#
body: <p>I have an Excel Template which i want to write into with data from a database. Whenever I edit and Save the file in c#,  when I open the template, Microsoft Office Excel says the file is corrupt. Apparently, I think I'm going about editing it wrongly. this is how i went about it below. I am using NPOI 2.0 beta 2. if it matters, the template contains macros and formulas</p>
  
  <pre><code>  FIleStream fs = new FileStream(pathString, FIleMode.Open, FileAccess.Read);
    IWorkbook wkb = WorkbookFactory.Create(fs);
  
    ISheet sheet = wkb.GetSheet("sheet1");
    ICell cell = sheet.GetRow(row).GetCell(column);
  
    if(cell != null)
    {
        cell.SetCellValue(value);
    }
  
    FileStream fs1 = new FileStream(pathString, FileMode.OpenOrCreate);
    wkb.Write(fs1);
  
   fs.CLose();
   fs1.Close();
  </code></pre>
  
  <p>But If I try to read the corrupted excel file, i can still retrieve values from the sheet using NPOI. Any pointers as to my errors. Thanks in anticipoation</p>