【发布时间】:2019-01-27 22:55:49
【问题描述】:
我正在尝试打开受密码保护的 Excel 文件(版本 xls、xlsx、xlsm)。我需要打开文件并从每个文件中删除密码。 我拥有要处理的文件的所有可用密码。
我不能使用 Microsoft Interop Excel,因为必须在服务器上安装 excel 才能使用。我已经在使用 Aspose.Cells 打开不受密码保护的文件。但我希望能够在没有密码的情况下保存文件覆盖它。
有人有什么建议吗?提前致谢
到目前为止的代码
public static void RemovePassword(string filePath, string password){
LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = password;
Workbook src = new Workbook(filePath, loadOptions);
//need a way of removing the password from the file.
}
【问题讨论】:
标签: c# excel excel-interop aspose aspose-cells