如何在不使用Microsoft.Office.Interop.Excel.dll的情况下创建受密码保护的Excel文件 [英] How to create a password protected excel file without using Microsoft.Office.Interop.Excel.dll

查看:154
本文介绍了如何在不使用Microsoft.Office.Interop.Excel.dll的情况下创建受密码保护的Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我创建了一个使用Microsoft.Office.Interop.Excel.dll创建受密码保护的excel文件的应用程序,但是当我上传它时在服务器上,未经授权的异常:由于以下错误,检索CLSID为{00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:抛出80070005。



配置后:在DCOM配置中。



Controlpanel - >管理工具 - >组件服务 - >计算机 - > myComputer - > DCOM配置 - > Microsoft Excel应用程序。

右键单击以获取属性对话框。转到安全选项卡并自定义权限。



我能够在本地解决此错误。但问题是在服务器微软办公室没有安装
,因此我无法在服务器中进行此设置,那么如何在服务器中创建受密码保护的excel文件。



任何建议和帮助都非常值得赞赏。



提前感谢你。

Dear all,

I have created an application to create a password protected excel file using Microsoft.Office.Interop.Excel.dll, but when I uploaded it on server, an unauthorized exception : Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 is thrown.

After configuring : In DCOM Config.

Controlpanel --> Administrative tools-->Component Services -->computers --> myComputer -->DCOM Config --> Microsoft Excel Application.
Right click to get properties dialog. Go to Security tab and customize permissions.

I was able to resolve this error in local. But problem is that in server microsoft office
is not installed, therefore i can't do this setting in server, then how can I create password protected excel file in server.

Any suggestion and help is highly appreciable.

Thank U in advance.

推荐答案

你可以使用 Open XML SDK [ ^ ]。



为了使文件受到保护,请参阅 - 使用Open XML SDK进行Excel文件密码保护 [ ^ ]。
YOu can use Open XML SDK[^].

For making the files protected, refer - Excel File Password Protection with Open XML SDK[^].


这篇关于如何在不使用Microsoft.Office.Interop.Excel.dll的情况下创建受密码保护的Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆