清风小子

 

求解:NPOI 如何读excel2007

刚刚接触Npoi,资料介绍中可以读写excel2007。我这在线审批excel系统主要就是操作excel,传统的那种com方式操作总是在后台服务器进程有许多未及时关闭的excel进程。

这种方式打开打开*.xlsx格式就报错

            using (FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                hssfworkbook = new HSSFWorkbook(file);
            }

报错 The supplied data appears to be in the Office 2007+ XML. POI only supports OLE2 Office documents

posted on 2011-12-30 10:00  清风小子888  阅读(1955)  评论(2编辑  收藏  举报

导航