且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VB.Net和Microsoft.Office.Interop.Word/Excel

更新时间:2023-01-17 10:51:25

第一个问题是您没有使用翻译器将错误转换为英语论坛的英语.

Well the first problem is you didn't use a translator to convert the error to english for an english forum.

" COM对象 可以 不能 转换 it Microsoft.Office.Interop.Word.ApplicationClass 类型 接口 类型 Microsoft.Office.Interop.Word._Application . 操作失败 ,因为 QueryInterface 通话 on COM组件 的接口 IID { 00020970-0000-0000 - C000-000000000046 }失败 具有以下 错误: 错误加载 类型库 文件. ( 中的异常 HRESULT: 0x80029C4A ( TYPE_E_CANTLOADLIBRARY ) )"

"COM object can not convert it to Microsoft.Office.Interop.Word.ApplicationClass type interface type Microsoft.Office.Interop.Word._Application. This operation failed because the QueryInterface call on the COM component for the interface with IID {00020970-0000-0000-C000-000000000046} failed with the following error: Error loading type library file. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))"

显然,某些库文件无法加载.我的猜测是Microsoft.Office.Interop库.Dll文件.

Apparently some library file can not be loaded. My guess would be the Microsoft.Office.Interop libraries .Dll file.

我不知道Windows 10的全新安装可能会如何影响.我不知道为什么重新安装Office 365可能会受到影响.

How a clean installation of Windows 10 may have affected that I do not know. Why a re-install of Office 365 may have affected that I do not know.

如果Windows 10的全新安装意味着系统磁盘已格式化,因此没有任何内容,然后安装Windows 10并运行系统,然后又安装了Office 365,而不是重新安装,则某些.Dll不是可能可用 无论出于何种原因.

If clean installation of Windows 10 means that the systems disk was formatted so nothing was on it and then Windows 10 was installed and the system ran and then Office 365 was installed rather than being re-installed then some .Dll isn't available maybe for whatever reason that would be.

但是,您还应该显示ex.StackTrace,它可能会提供更多信息来解决问题.

You should however also display ex.StackTrace which may provide greater information for resolving the issue.

        Try

           WD_App.Visible = True

         Catch ex As Exception
               MessageBox.Show(ex.Message & vbCrLf & vbCrLf & ex.StackTrace)
         End Try