Question

I'm looking to parallelize a Excel calculation on a HPC grid, I'm using Excel 2007 so I'm trying to multithread it through the UDF in a XLL because it is the only way (at least for 2007).

I would like to code the XLL in C# and as this thread suggests I can use exceldna.

Yet I can't understand how should I multithread it. Do I have to re-write all the VBA function in C# while multithreading it ? Can I just create several threads, each one of them calling one VBA macro ?

Was it helpful?

Solution

Excel-DNA allows different approaches that you might find useful:

In none of these cases would it make sense to call into Excel VBA - Excel will always ensure that the VBA code is running on Excel's main thread.

If your function code is in VBA, you might consider using VB.NET for your Excel-DNA add-in, instead of C# - it might make your move to .NET quite easy. You could also make a mixture of C# and VBA in your managed Excel-DNA add-in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top