This project is read-only.

XLSX to XLS style problem

Jul 8, 2014 at 7:13 AM
Edited Jul 8, 2014 at 7:15 AM
Hello,

When I save a xlsx as in xls format and open with NPOI, HSSFWorkbook. Style are dissappeared in saved xls file.

Here is my Code

using (FileStream f = new FileStream(file, FileMode.Open, FileAccess.ReadWrite))
{
                IWorkbook wb = WorkbookFactory.Create(f);

                //wb = new HSSFWorkbook(wb);

                maskXLSWorkbook(wb);

                newFileName = outputFolderName + "\\" + maskId + "_" +Path.GetFileName(file);
using (FileStream stream = new FileStream(newFileName, FileMode.Create, FileAccess.ReadWrite))
{
          try
          {
                 wb.Write(stream);
            }
           catch {

                    }
             }
}