如何使用EPPlus读取具有工作簿保护的Excel 2010文件? [英] How to use EPPlus read an Excel 2010 file that has workbook protection?
本文介绍了如何使用EPPlus读取具有工作簿保护的Excel 2010文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用下面的代码读取为工作簿启用密码保护的Excel 2010文件时:
When I use the code below to read an Excel 2010 file that has password protection enabled for the workbook:
using (FileStream file = new FileStream(fileName,
FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite))
{
ExcelPackage ep = new ExcelPackage();
try
{
ep = new ExcelPackage(file);
}
catch (Exception ex)
{
string strErr = ex.message;
}
}
...我有一个例外。使用EPPlus读取具有密码保护的Excel 2010文件的任何示例代码?
...I get an exception. Any example code to read a Excel 2010 file that has password protection, using EPPlus?
推荐答案
也遇到同样的问题。在Excel 2010中,加密算法与2007年不同。幸运的是,EPPlus 4.0 Beta 2 已发布。在2010+上可以正常工作,但不能解密2007 excel。
Faced with the same problem. In Excel 2010 encryption algorythm is differs from 2007. Fortunately EPPlus 4.0 Beta 2 was released. Works fine with 2010+, but can not yet decrypt 2007 excel.
这篇关于如何使用EPPlus读取具有工作簿保护的Excel 2010文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文