无法转换“Microsoft.Office.Interop.PowerPoint.Application”类型的COM对象 [英] Unable to cast COM object of type 'Microsoft.Office.Interop.PowerPoint.Application'

查看:283
本文介绍了无法转换“Microsoft.Office.Interop.PowerPoint.Application”类型的COM对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有asp.net的vs2010 c#创建power point应用程序。



我使用的是Windows Server 2008 R2企业版和Microsoft Office professional plus 2007,vs2010 。



我尝试在XP sp2中使用IIS 5.1,微软办公专业版加上2007和vs2010工作正常。



使用IIS工作正常。



如果我连接到IIS我收到以下错误



I am creating power point application using vs2010 c# with asp.net.

I am Using windows server 2008 R2 enterprise edition and Microsoft office professional plus 2007, vs2010.

I tried in XP sp2 with IIS 5.1, Microsoft office professional plus 2007 and vs2010 its working fine.

It was working fine with out using IIS.

If I connect to the IIS I am getting the below error

错误:

'/LOUPeProject.WebDummy'应用程序中的服务器错误。



无法将System .__ ComObject类型的COM对象强制转换为接口类型Microsoft.Office.Interop.PowerPoint.Application。此操作失败,因为对于具有IID{91493442-5A91-11CF-8700-00AA0060263B}的接口的COM组件的QueryInterface调用由于以下错误而失败:库未注册。 (HRESULT的例外情况:0x8002801D(TYPE_E_LIBNOTREGISTERED))。



描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。



异常详细信息:System.InvalidCastException:无法将System .__ ComObject类型的COM对象强制转换为接口类型Microsoft.Office.Interop.PowerPoint.Application。此操作失败,因为对于具有IID{91493442-5A91-11CF-8700-00AA0060263B}的接口的COM组件的QueryInterface调用由于以下错误而失败:库未注册。 (HRESULT异常:0x8002801D(TYPE_E_LIBNOTREGISTERED))。

来源错误:

第2347行:}

第2348行:

行2349:Microsoft.Office.Interop.PowerPoint.Application pptApplication = new Microsoft.Office.Interop.PowerPoint.Application();

2350行:

行2351:Microsoft.Office.Interop.PowerPoint.Slides slide;

Server Error in '/LOUPeProject.WebDummy' Application.

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.PowerPoint.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{91493442-5A91-11CF-8700-00AA0060263B}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

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.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.PowerPoint.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{91493442-5A91-11CF-8700-00AA0060263B}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
Source Error:
Line 2347: }
Line 2348:
Line 2349: Microsoft.Office.Interop.PowerPoint.Application pptApplication = new Microsoft.Office.Interop.PowerPoint.Application();
Line 2350:
Line 2351: Microsoft.Office.Interop.PowerPoint.Slides slides;



请帮我解决这个问题。可能是库未注册的内容。


Kindly help me out this issue. What might be the Library not registered.

推荐答案

您应该检查<$ c中是否安装了 PowerPoint $ c> IIS 系统与否。如果已安装,您可以执行操作,否则您不能。



按照我的提示 - 如何检查PowerPoint是否安装在系统中 [ ^ ]中。
You should check whether PowerPoint is installed in the IIS system or not. If installed, you can do the operations, else you can't.

Follow my Tip - How to Check Whether PowerPoint is Installed in the System or Not[^] for that.


这里我们需要在iis当前项目应用程序池中进行一些设置



在IIS当前Applicationpool-高级设置中 - 启用32位应用程序集它是真的。



现在一切正常。
Here we need to some settings in iis Current project application pool

In IIS Current Applicationpool-advanced settings- enable 32 bit application set it to True.

Everything works fine now.


这篇关于无法转换“Microsoft.Office.Interop.PowerPoint.Application”类型的COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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