in reply to How can make a consult from M$ Excel to a perl program?

The easiest way to do this, is to buy the developer kit from activestate. This will allow you to make an activex componet with perl. After you have done that, you can now make calls to the componet from excel. Another option is to write an activex componet in c/vb and have it wrap around your perl program. Finaly, you can call your perl program from excel, then have your perl program use OLE to modify your excel spreadsheet.
  • Comment on Re: How can make a consult from M$ Excel to a perl program?

Replies are listed 'Best First'.
Re: Re: How can make a consult from M$ Excel to a perl program?
by InfiniteSilence (Curate) on Mar 20, 2001 at 19:44 UTC
    What???? I am sorry, but you do not have to create custom ActiveX components to access Excel/Access/Word from Perl. These already exist for you and they work very well.

    May I introduce you to the Win32 libraries which contain the OLE object? The code to access Excel looks something like so:

    use Win32::OLE; $class = "Excel.Application"; $File = qq(c:\\temp\\Mytext.xls); $Excel = Win32::OLE->GetActiveObject($Class); $Excel->(Visible);

    Now, the underlying mechanics of Win32 actually involve DLLs that are performing the low level calls to Windows resources, but why reinvent the wheel? Roth even offers you source code at his site. His book shows you how to extend Perl for Win32 as well.

    For more information, look up Win32 at CPAN or buy Windows NT Win32 Perl Programming by Dave Roth.

    Celebrate Intellectual Diversity

      Reduce, reuse, recycle... Go perl!

      You may also wish to consider obtaining modules for ActiveState via PPM, as well as CPAN.

      That isn't what I said. I said you needed to create a custom activex compnent to access your perl program from Excel (which is what he asked for). What you show above is part of what is needed for my third sugestion.

      P.S. In my opinion, OLE is better then Win32::OLE (as in OLE hasn't crashed and Win32::OLE has).