Uniface User Forum

 View Only
  • 1.  Libreoffice integration

    Posted 04-24-2024 04:07

    Hi Unifacers

    with U9/U10 we succesfully read and write Microsoft Excel cells using the (very old) DDE method; so basically we open a Microsoft Excel file, and while open in the background doing the following:

    $50 = "Excel"

    $51 = "c:\temp\filename.xls"

    $52 = "R1C1"

    perform "UDDEREQUEST"

    and we get succesfully in $53 the value of the cell

    is there a way to do the same with LibreOffice Calc instead of Microsoft Excel? I googled something and just found that I should replace my instructions like this:

    $50 = "soffice"

    $51 = "c:\temp\filename.xls"                 (or filename.ods)

    $52 = "nameofthesheet.C1"

    but it does not work.. anyone tryed to do something similar? or you left alone DDE and went to other methods like OLE or others?

    a working example would be great

    thank you

    Simone



    ------------------------------
    Simone Pecchenino
    Labinf Sistemi Srl
    IT
    ------------------------------


  • 2.  RE: Libreoffice integration

    Posted 05-15-2024 16:55
    Edited by Gianni Sandigliano 05-15-2024 16:56

    Ciao Simone,

    this is a working DDE link in a cell of an OpenOffice Calc spreadsheet to link a cell in an Excel spreadsheet via DDE:

    =DDE("Excel";"C:\Users\sandiglianog\Documents\[Cartel1.xlsx]Foglio1";"R2C1")

    In this case Calc is acting as requester and Excel is answering to the request; that link works only if the Excel file is opened when Calc file is updated.

    I understand you need the reverse direction with Uniface acting as requester and Calc answering to the request but I was NOT able to have it working.

    Hope it helps...

    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------



  • 3.  RE: Libreoffice integration

    Posted 05-16-2024 02:25
    Edited by Gianni Sandigliano 05-16-2024 02:32

    Ciao Simone,

    I've just found a working example on the web... three items to be noted:

    1) The correct format is: =DDE("soffice";"FullFilename";"'SheetName'.a1"). Please note those simple ticks surrounding sheet name.
    2) Automatic update via DDE/external links is disabled by default on LibreOffice for security reasons
    3) The data source spreadsheet MUST be open to guarantee the update

    I've used latest LibreOffice 24.2 to test it.

    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------



  • 4.  RE: Libreoffice integration

    Posted 05-16-2024 03:42

    thank you Gianni!

    I'm trying this asap

    so writing is disabled by default and can't be enabled, or can it be?

    thank you

    Simone



    ------------------------------
    Simone Pecchenino
    Labinf Sistemi Srl
    IT
    ------------------------------



  • 5.  RE: Libreoffice integration

    Posted 05-16-2024 04:14

    Ciao Simone,

    I have currently NO answer to your question... probably there is a checkbox somewhere to be ticked/unticked... you should check by yourself into documentation.

    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------