HSSFWorkbook.GetCustomPalette and file's modify date strange behavior

Oct 17, 2013 at 11:58 AM

I have a strange behavior with XLS file produced by NPOI 2.0 (haven't test older version) using the following simple code :
HSSFWorkbook hssfworkbook = new HSSFWorkbook();
//string filePath = @"Z:\Shared\myfile.xls";
string filePath = @"C:\temp\myfile.xls";

var sheet = hssfworkbook.CreateSheet("Test");
HSSFPalette palette = hssfworkbook.GetCustomPalette();

// Write the stream data of workbook to the root directory
using (FileStream file = new FileStream(filePath, FileMode.Create))
Opening the file on local folder using Excel 2007 doesn't update its modify date, and closing without modification doesn't update it neither.

Opening the file on network folder using Excel 2007 updates the modify date and will do so on each open until you save the file by Excel manual save. On closing the modify date isn't updated.

In this network case, Excel is not even asking me if I wish to save the file ...

If I remove the GetCustomPalette line the strange network behavior is no more.

Does anyone had the same issue ? What's the underlying problem ?