Accessing perl from VB...
Fifer, Eric
EFifer@sanwaint.com
Wed Jul 26 06:33:00 GMT 2000
John.Velman wrote:
>Last spring I desparately needed to use Perl's regular expression
>capabilities in a VBA program that was doing transformations on
>a huge Excel file. I found that the Active State perl has a perl dll
>(and directions for using it), so I installed the Active State perl.
I know of a few different ways to go at this, although this is a little
off topic for a Cygwin group.
+ ActiveState Perl (calling from VBA to Perl)
+ PerlEZ.dll: a simple DLL that can be loaded by VBA and
creates a perl interpreter from which you can do most
perl things (kinda buggy IMHO).
+ PerlCOM: exposes Perl as a COM object, from VBA you
can do CreateObject, etc.
+ Microsoft ActiveX Scripting Control: a COM object that
provides hooks into Microsoft's scripting engine which
in turn can call into PerlScript as well as other languages.
+ Win32::OLE (calling from Perl to ActiveX)
Allow calls from Perl into any ActiveX (aka COM, OLE) object like
Excel. Also, works well in combination with the above.
The latest Win32-OLE-0.13 compiles relatively cleanly on Cygwin.
Attached is a patch that works around a know gcc bug. The
Win32::OLE maintainer is aware of the problem, but since it is
a gcc bug ...
How did you solve your problem?
>I'd just as soon de-install the Active State perl. Question: how hard
>would it be to get at the perl functions from VBA using libperl5_6_0.dll?
I have some patches to Win32::OLE that basically takes the PerlEZ approach
of creating a DLL that can be loaded by VBA (only tested with Excel) and
has an embedded Perl interpreter.
After corresponding with Jan Dubois, the Win32::OLE maintainer, I've been
planning to clean it up and upload to CPAN. If your interested, I can
try to do this sooner rather than later.
Regards,
Eric Fifer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Win32-OLE.patch
Type: text/x-diff
Size: 949 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20000726/e6354696/attachment.bin>
More information about the Cygwin
mailing list