[Solved] Create Uno Service DDE

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
matheuslage
Posts: 2
Joined: Sat Jan 02, 2021 3:06 am

[Solved] Create Uno Service DDE

Post by matheuslage »

Hello,

I'm trying to get DDE data from open office basic and my object come Null,

Dim oDDE as Object

oDDE = CreateUnoService( "com.sun.star.sheet.DDELink" )
oDDE = CreateUnoService( "com.sun.star.sheet.DDELinks" )
oDDE = CreateUnoService( "com.sun.star.sheet.DDELinksEnumeration" )

i try get com.sun.star.container.XNamed (only exemple to try remove my Object of NULL)
i think that i dont know the correct address i need use.


I'm trying create one script in basic that i get the same data of function =DDE("xxx";"xxx";"xxxxxx") return to me,
but i dont want get this data from cell, i want generate this function (=DDE("xxx";"xxx";"xxxxxx")) in basic.

If somebody know how solve it , i will be grateful.
Last edited by matheuslage on Sat Jan 02, 2021 7:56 pm, edited 1 time in total.
OpenOffice 4.1.7 Windows 10
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Create Uno Service DDE

Post by Lupp »

I would assume a DDELink service can only exist as an element of the DDELinks property (container) of a spreadsheet document.
Therefore neiter the "general context" nor the document can create it, but it must be added to the container on creation.
See https://api.libreoffice.org/docs/idl/re ... Links.html (e.g.)

Code: Select all

Sub example
doc = ThisComponent REM a spreadsheet document
ddeLks = doc.DDELinks
myLink = ddeLks.addDDELink(arg1, arg2, arg3, arg4)
REM Arguments need to be valid instances of the appropriate types.
End Sub
Disclaimer: I never created a working DDELink this way.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
matheuslage
Posts: 2
Joined: Sat Jan 02, 2021 3:06 am

Re: Create Uno Service DDE

Post by matheuslage »

tksss, it worked for me!

exactly what i need,

I am so gratefull
OpenOffice 4.1.7 Windows 10
Post Reply