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.
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:
Now you can typeOption Explicit
Private sc As New ScriptControl
Public Function uc(txt As String) As String
sc.Language = "PerlScript"
uc = sc.Eval("uc(" & txt & ")")
End Function
=uc("hello")
in your
spreadsheet to call the above function.
You can even use
modules; I had an
example using Lingua::EN::Numbers, but I can't
lay my hands on it at the moment.
Hope this helps.
Re:Microsoft Script Control (Perlscript in Excel)
darobin on 2003-01-22T14:26:26
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.