VB.NET - Emedding Powerpoint对象时出错

时间:2016-12-01 10:04:15

标签: vb.net powerpoint

请温柔,我是新手!

我正在尝试将Powerpoint查看器嵌入到VB.NET表单中。当我运行以下代码时,它会抛出异常:

Imports PowerPoint = Microsoft.Office.Interop.PowerPoint

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs)
        Handles Button1.Click

        Const PPTFile = "C:\Report.pptx"
        Dim oPPTApp As PowerPoint.Application
        Dim oPPTPres As PowerPoint.Presentation
        oPPTApp = New PowerPoint.Application()
        oPPTPres = oPPTApp.Presentations.Open(PPTFile)
    End Sub
End Class
  

System.Runtime.InteropServices.COMException未处理
  ErrorCode = -2147221164 HResult = -2147221164 Message =正在检索   具有CLSID的组件的COM类工厂   {91493441-5A91-11CF-8700-00AA0060263B}由于以下原因而失败   错误:80040154未注册类(HRESULT异常:   0x80040154(REGDB_E_CLASSNOTREG))。源= mscorlib程序

代码是否有问题,或者是“未注册的课程”中的线索?如果是,我怎么知道哪个班?

由于

0 个答案:

没有答案