我想使用ASP.NET VB.NET在本地计算机上使用COM referance创建excel文件它工作正常但在服务器上获取错误,错误如下: [英] I am tring to create excel file using ASP.NET VB.NET using COM referance on local machine it work fine but on server getting error , error is follows:

查看:81
本文介绍了我想使用ASP.NET VB.NET在本地计算机上使用COM referance创建excel文件它工作正常但在服务器上获取错误,错误如下:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于以下错误,检索CLSID为{00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:80040154未注册类(HRESULT异常:0x80040154(REGDB_E_CLASSNOTREG))。



我尝试过:



我在vb.net页面上使用COM referance库它在本地工作正常,但在服务器上传网站时会出现错误

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

What I have tried:

I use COM referance library on in vb.net page it work fine on local but on uploading website on server it get error

推荐答案

您需要在服务器上安装Excel才能实现此功能,但即使这样您也不会让它工作,不支持通过asp.net自动化Excel。您需要使用在asp.net下工作的库,如EPPlus,XML SDK等。
You need Excel installed on the server for this to work, but even then you won't get this to work, automating Excel via asp.net is not supported. You'll need to use a library that works under asp.net like EPPlus, XML SDK etc.


您不能在ASP.NET应用程序中通过Interop使用任何Office应用程序。 Office应用程序不支持重入,某些功能需要在控制台上登录用户才能正常工作。



当然,它可能在您的开发机器上运行正常,但是当您开始让多个用户同时点击此代码时,它会出错并且您我不知道为什么。



您将需要使用不同的库在ASP.NET应用程序中执行Excel工作,例如OpenXML library,ClosedXML,EPPlus或其他。
You cannot use any Office app via Interop in an ASP.NET app. Office apps do not support reentrancy and some functions require a logged on user at the console in order to work properly.

Sure, it may work fine on your dev machine, but the minute you start having multiple users hit this code at the same time, it'll error out and you won't have a clue why.

You're going to need to use a different library to do Excel work in your ASP.NET app, such as the OpenXML library, ClosedXML, EPPlus, or others.


这篇关于我想使用ASP.NET VB.NET在本地计算机上使用COM referance创建excel文件它工作正常但在服务器上获取错误,错误如下:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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