如何将LibreOfficeCalcPortable.exe作为对象从Catia VBA进行交互。我在下面写下了从Catia VBA与MS Excel进行交互的方法。如何在CATIA VBA的LibreOfficeCalcPortable.exe中写入单元?
示例Catia到Excel。
Dim Excel As Object
On Error Resume Next
Set Excel = GetObject(, "EXCEL.Application")
If Err.Number <> 0 Then
Err.Clear
Set Excel = CreateObject("Excel.Application")
End If谢谢!
发布于 2021-11-12 00:22:09
这是一个我刚才在LibreOffice 7.2中测试的VBScript计算示例。有关如何适应VBA,请参阅@FaneDuru的评论。
Set oSM = CreateObject("com.sun.star.ServiceManager")
Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
Dim arg()
Set wb = oDesk.loadComponentFromURL("private:factory/scalc", "_blank", 0, arg)
Set oSheet = wb.CurrentController.ActiveSheet
oSheet.getCellByPosition(1, 2).String = "Hello world!"
MsgBox "The End"https://stackoverflow.com/questions/69927454
复制相似问题