excelcomdde

Get data from custom app into EXcel


I would like to be able to link some data from a custom application to a cell in Excel.

What tech would you use to do that? I'm primarily a Unix-developer, and don't know win32 technologies in depth. But as far as I understand DDE would be the easiest, even though it is very old tech.

Being able to use it with other office suites such as OpenOffice would be a big bonus.


Solution

  • What does it mean "link data from a custom app to a cell in Excel"?

    Do you want the Excel sheet to display data that is generated by some external app?

    If that is the case there are a number of options. The Excel data provider is one way to go. This works if you have lots of data you'd like to load. For just one cell, it may be overkill.

    If the external data is accessible via a network interface (let's say, HTTP), then you can write some Excel macro code to consume it. You could use the ServerXmlHttp object to consume it, from within Excel. Some guidance on that is HERE.

    Another way to do it is to expose the data via a custom COM object, a re-use construct that is very consumable by Excel. You'd have to write some code to do it, but it's not too complicated. You can write it in .NET, C++, Javascript, VBScript, PerlScript, ...