Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

darobin (1316)

darobin
  (email not shown publicly)
http://berjon.com/

Journal of darobin (1316)

Wednesday January 22, 2003
06:53 AM

PerlScript in Excel

[ #10116 ]

Has anyone used the above combination? A friend of mine has an assignment to write a client in Excel (don't ask) that fetches some XML from a server and updates the cells dynamically. Writing the file from the outside is not an option, so I was wondering if using PerlScript (instead of VBA) from inside Excel would be a good idea, and if anyone could point me in the right direction to know how to get it to work.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • If you haven't got the Microsoft Script Control, download it from somewhere in http://msdn.microsoft.com/scripting [microsoft.com].

    Then in Excel, set Tools - References - Microsoft Script Control.

    In your code, you can now eval and execute Perl code, and use it in any Functions that you've declared as public - here's a trivial example:

    Option Explicit
    Private sc As New ScriptControl

    Public Function uc(txt As String) As String
        sc.Language = "PerlScript"
        uc = sc.Eval("uc(" & txt & ")")
    End

    --

    osfameron

    • Thanks a lot this really really helps. I'm left with what looks like a problem anyone with VBA experience must know about but I don't... When I try to call my function, what appears in the sheet is "#VALUE!". Obviously there is some sort of error on the value I'm feeding it, but I can't seem to get it to go away and Google ain't helping :/

      Thanks a lot, as soon as I sort this out it ought to make someone's life a lot more viable.

      --

      -- Robin Berjon [berjon.com]