DDE Function (LibreOffice Calc)

Data Exchange Advanced LibreOffice Calc Introduced in LibreOffice 3.0
data-exchange interoperability automation external-links legacy-protocols

The DDE function retrieves data from another running application using the Dynamic Data Exchange protocol. It enables live links between Calc and external programs.

Compatibility

What the DDE Function Does

  • Connects to another running application
  • Retrieves live data from that application
  • Updates automatically when the source changes
  • Uses the legacy Windows DDE protocol
  • Works only when the external program supports DDE

Syntax

DDE(server; topic; item)

Arguments

  • server:
    Name of the application providing the data (e.g., "soffice", "excel").

  • topic:
    Document or data channel (e.g., a filename).

  • item:
    Specific data element (e.g., a cell reference).

Basic Examples

=DDE("soffice"; "file:///C:/Data/Sheet1.ods"; "Sheet1.A1")
=DDE("excel"; "C:\\Data\\Book1.xlsx"; "Sheet1!A1")
=DDE("myapp"; "status"; "current_value")

Advanced Examples

Use DDE to build a live dashboard

=DDE("excel"; "C:\\Finance\\Rates.xlsx"; "Rates!B2")

Pull data from a real‑time feed (if the app supports DDE)

=DDE("tradingapp"; "quotes"; "AAPL")

Combine with calculations

=DDE("excel"; "Book1.xlsx"; "Sheet1!A1") * 1.25

Validate DDE availability

=IFERROR(DDE("excel"; "Book1.xlsx"; "Sheet1!A1"); "Not available")

Edge Cases and Behavior Details

DDE returns text or numbers, depending on the source

Behavior details

  • Requires the external application to be running
  • Requires the external application to support DDE
  • Links may break if file paths change
  • DDE is a legacy Windows protocol
  • Not supported on macOS or Linux
  • Security settings may block external links

If the source is unavailable → Err:509 or Err:540

Common Errors and Fixes

Cause:

  • Application not running
  • Wrong server/topic/item
  • Unsupported DDE provider

Fix:

  • Start the application
  • Verify topic and item names

Err:540 — External content disabled

Cause:

  • Security settings blocking external data

Fix:

  • Enable: Tools → Options → Security → Options → “Allow updating external links”

Data not updating

Cause:

  • Source application not refreshing
  • DDE provider not pushing updates

Fix:

  • Restart source app
  • Use manual refresh

Best Practices

  • Use DDE only when you must link to a legacy Windows application
  • Prefer modern alternatives (CSV import, WebService, APIs)
  • Document all external dependencies
  • Avoid DDE in mission‑critical models
  • Use IFERROR to handle unavailable sources gracefully
DDE is powerful but fragile — it’s best used for controlled environments where both applications are guaranteed to be running and stable.

Related Patterns and Alternatives

  • HYPERLINK — link to external resources
  • WEBSERVICE / FILTERXML — pull data from web APIs
  • External references — link to other Calc files
  • CSV import — stable data ingestion
  • Macros / UNO API — advanced automation

By mastering DDE, you can integrate Calc with external applications and build live, cross‑program data workflows.

Copyright 2026. All rights reserved.