Execute a DDE call in Base

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
doncell6
Posts: 73
Joined: Wed Jul 24, 2013 6:26 am

Execute a DDE call in Base

Post by doncell6 »

I have searched the forum and the Base pdf file, cannot find an answer to my question.

I am a LibreOffice novice.

How do I execute a dde call in Base? Perhaps someone has a snippet of code they might share?

Thank you.
Version 4.3.7.2 on Windows 7 Pro
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Execute a DDE call in Base

Post by F3K Total »

Hi,
in my opinion, it's not that simple, 'cause i couldn't find a way to use DDE via Starbasic without an OpenOffice-crash.

So i tried this way, which works:
  • load a calc-doc
    • containing the DDE-Link
    • hidden mode
    • from a BASE-document
  • add a DDE-refresh listener ("com.sun.star.util.XRefreshListener") to the DDE-Link in the calc-doc
  • refresh the link once by code, to activate it
  • on _refreshed Event, insert a new row into the database
Find attached three files as a sample:
  • DDE_Source.ods to simulate a DDE-Source
  • DDE_Bridge.ods loaded in hidden mode, receiving the Values from DDE_Source.ods
  • DDE_Target.odb the stearing file, DDE-values will be inserted into table DDE_RESULT
Before you can run it, you have to prepare:
  • Open DDE_Source.ods
  • select cell A1 on Sheet 1 and copy it to the clipboard.
  • open DDE_Bridge.ods
  • insert clipboard-content as DDE-Link to cell A1 of Sheet 1 of DDE_Bridge.ods to replace my current DDE-Link
  • store both calc-docs
  • close DDE_Bridge.ods
Now you can try and learn from the sample:
  • be shure to have adjusted macro-security at least to middle, that you can run macros
  • open DDE_Target.odb
  • open Form DDE_RESULT
  • change to DDE_Source.ods
  • enter a new value into cell A1
  • observe Form DDE_RESULT
Please let us know if this helped
R
Attachments
DDE_Source.ods
(7.18 KiB) Downloaded 335 times
DDE_Bridge.ods
(7.34 KiB) Downloaded 386 times
DDE_Target.odb
(13.28 KiB) Downloaded 275 times
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
doncell6
Posts: 73
Joined: Wed Jul 24, 2013 6:26 am

Re: Execute a DDE call in Base

Post by doncell6 »

Thank you very much for replying with lots of detail. I'll try this just as soon as possible. I am a novice LibreOffice user so I'm sure I'll have more questions.
Version 4.3.7.2 on Windows 7 Pro
Post Reply