无法创建Activex对象 [英] Cannot Create Activex Object

查看:90
本文介绍了无法创建Activex对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Createobject("Excel.Application")
时 当我在工作时,它做得很好.但我将页面上传到了Web服务器.它显示错误无法创建Activex对象.

when i am using Createobject("Excel.Application")
while i m working then it is doing great. but i upload the pages to the webserver.. it is showing an error Cannot Create Activex Object.

推荐答案

我认为这是在您的javascript中?只要运行的计算机上装有Excel,它就可以正常工作.也许如果您发布了一些代码,我们可以进一步评论.编辑您的帖子以添加代码段.

我用谷歌搜索,每个例子我都能找到这类代码,是针对ASP(不是ASP.NET)应用程序服务器上的代码的..............................................................................在这种情况下,您的问题(除了残破的标记之外)可能是您需要在服务器上使用Excel,以便在服务器上编写使用Excel进行处理的代码.
I assume this is inside your javascript ? That should work regardless, so long as the computer it''s run on, has Excel on it. Perhaps if you posted some code, we could comment further. Edit your post to add a code snippet.

I googled and every example I can find of this sort of code, is for code on the server of an ASP ( not ASP.NET ) app. In that case, your problem ( apart from the broken tag ) would be that you need Excel on the server, to write code that uses Excel to do stuff, on the server.


具有CLSID {00024500-0000-0000-C000-000000000046}的组件的COM类工厂由于以下错误而失败:80040154.

说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.

异常详细信息:System.Runtime.InteropServices.COM异常:由于以下错误,检索具有CLSID {00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:80040154.

源错误:


第90行:filename = filename和"\ pl.xls"
第91行:
第92行:将Dim obj用作新Excel.Application
第93行:点心书= obj.Workbooks.Open(文件名)
第94行:Dim sheet = obj.Worksheets(1)
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.

Source Error:


Line 90: filename = filename & "\pl.xls"
Line 91:
Line 92: Dim obj As New Excel.Application
Line 93: Dim book = obj.Workbooks.Open(filename)
Line 94: Dim sheet = obj.Worksheets(1)


这篇关于无法创建Activex对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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