hubFS: THE place for F#
. . . are you on The Hub?
Welcome to hubFS: THE place for F#
Sign in
|
Join
|
Help
in
Applications of F# (forum)
Establish skills in F# (group)
(Entire Site)
Search
Home
Blogs
Forums
Photos
Files
Roller
hubFS: THE place for F#
»
Establish skills in F#
»
Applications of F#
»
Run F# from Excel VBA?
Run F# from Excel VBA?
Last post 07-06-2009, 22:48 by
prendebp
. 2 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
07-02-2009, 18:27
11175
prendebp
Joined on 12-24-2008
Posts 6
Run F# from Excel VBA?
Do you think it would be worthwhile writing a .NET COM wrapper (tied to an F# library) that could be called from VBA/Excel Formulas? I am thinking that this would allow parallel processing within Excel VBA :-)
My immediate concerns: (1) is the Excel/Office team already working to allow Excel VBA to do parallel processing natively? (2) would marshalling Excel ranges across to double or decimal arrays in .NET and back again be too costly in itself and make gains made via F# not worth it?
I have a client who has a long-running VBA recursive function. I do need to discern: is it long-running just because it's recursive, or because it links to many other spreadsheets, or because it is merely crunching large amounts of data . . . as I do realize the gains of the F# COM Wrapper may depend on these details.
Still, this is compelling to me. Any comments, thoughts, or opinions from the F# community?
Thanks,
Bryan
PS I do think trading application developers might be interested. This approach reminds me of the product managedxll available at www.managedxll.com . . . but what I am proposing is much simpler and home-grown, maybe what I am proposing would best be completed as a codeplex project?
Report abuse
07-03-2009, 8:39
11176
in reply to
11175
DannyAsher
Joined on 09-05-2007
Posts 157
Re: Run F# from Excel VBA?
I'd steer clear of COM if you can. Try
ExcelDna
and/or
VSTO
- it's almost certainly worthwhile.
regards,
Danny
Report abuse
07-06-2009, 22:48
11207
in reply to
11176
prendebp
Joined on 12-24-2008
Posts 6
Re: Run F# from Excel VBA?
Thanks for the reply . . . I appreciate your feedback. That ExcelDNA looks very interesting, and may help guide me. As for VSTO, I did originally look at that but such a solution required me to maintain and deploy (and re-deploy) the code libraries.
The interesting thing about using an F# COM wrapper is that I can then expose libraries directly to my Excel power user so that this user may continue to write and maintain his own custom VBA, but now with the power to also reference/call out to my newly exposed F# wrapper method calls.
I already have a working barebones prototype using simple scalar values, but I need to also add support for marshalling arrays from Excel to double or decimal arrays in COM. Moreover, I need to optimize it and test whether it yields any performance gains.
Actually, my first move may be to get my power user a multi-core PC and benchmark any potential improvement just from that; perhaps, Excel already contains some minimal support for running on multiple processors?
Report abuse
Copyright (c) 2006-2009, JJB Research.