Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I need a program to send and receive data (with real time updates) to an open Excel spreadsheet that would receive data via DDE links from other servers (Excel is too stupid to do what I want).

It seems that Perl can do anything, so I thought I would examine its suitability first. :)

I found a module called Win32::OLE, but it appears to only make Perl function as a DDE client (if I understood the documentation - certainly a dubious assumption).

Random questions:

1. Do modules exist to do this, and if so, which ones?

2. Does anyone have or know of any example code I could use as a starting point?

3. I have written a few (small and simple) Perl programs on Linux, but I would do this on Windows (I have Cygwin installed). Any thoughts or caveats specific to Cygwin?

4. (separate, but related, even if a little theoretical) - Can I write a DDE client in Perl to grab ANY data that I could get in Excel? 4a. Would a DDE server restrict its data to Excel only, or could any program receive it (with the right syntax)?

Thank you for your wisdom.

Replies are listed 'Best First'.
Re: DDE Server? Client?
by tachyon (Chancellor) on Mar 26, 2004 at 02:29 UTC

    ActiveState provide Win32::DDE and Win32::DDE::Client. It is not part of the standard Active Perl distribution (which is what you want, not Cygwin) Get ActivePerl then get Win32::DDE via PPM

    ppm install Win32::DDE

    Search their site for example code in the discussion lists.

    Win32::OLE lets you do more of less anything you can do in VB(S) in Perl but if you don't know VB it will be difficult to get to grips with it for anything that is not trivial.

    cheers

    tachyon

      OK, I installed Active Perl, but ppm couldn't find Win32::DDE (and I couldn't find it in the list of modules for either 5.6 or 5.8 -
      http://ppm.activestate.com/BuildStatus/5.8.html ).

      I do see it here:
      http://aspn.activestate.com/ASPN/Modules/Perl/dist_html?dist_id=9961

      Does that mean it exists for 5.6 only (of course I installed 5.8)?

      On the other hand, an internet search found it here:
      http://www.bribes.org/perl/ppmdir.html

      Recommendations?

        Yes it is only available for 5.6. Get 5.6. Get ppm.zip from here http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/Win32-DDE.zip Install.

        I have not looked at it but it will almost certainly be a binary so incompatible between 5.8/5.6 You need VCC to compile binaries on win32. See Tutorials for my module install/compile guides.

        cheers

        tachyon