ole32.dll DllNotFoundException
本文关键字:DllNotFoundException dll ole32 | 更新日期: 2023-09-27 18:30:43
有没有办法在Ubuntu中使用Excel/Office库?
我开发了一个 C# 程序,它将 Excel 电子表格和一些 VB 宏粘合在一起。它使用以下内容。
Excel 和 Office 库:Microsoft.Vbe.Interop.dllMicrosoft.Office.Interop.Excel.dll 和 Office.dll.它在Windows中运行良好,但我无法使用Mono 3.2在Ubuntu上运行它。
当我尝试执行它时(添加我使用 gacutil -l XXXX.dll 显式导入的库后)输出如下:
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: ole32.dll
at (wrapper managed-to-native) System.__ComObject:CoCreateInstance (System.Guid,intptr,uint,System.Guid,intptr&)
at System.__ComObject.Initialize (System.Type t) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.__ComObject:Initialize (System.Type)
at Mono.Interop.ComInteropProxy.CreateProxy (System.Type t) [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.RemotingServices.CreateClientProxyForComInterop (System.Type type) [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Activation.ActivationServices.CreateProxyForType (System.Type type) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
at MyProgram.Program.joinMacroAndExcel () [0x00000] in <filename unknown>:0
at MyProgram.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
任何帮助或指导将不胜感激。 提前谢谢。
乔希
Excel
/Office集成库要求已经安装了Office才能运行 - 仅复制PIA(例如Microsoft.Office.Interop.Excel.dll)是不够的,因为它们充当了Excel等人公开的COM层的桥梁。没有 COM 层,就无法执行您要求它的工作。