0

I have been searching the web to see how to use the TPL library in excel vba, but haven't succeded to do so. Could anyone help?

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
David
  • 38
  • 6
  • VBA does not support multi-threading. – Pᴇʜ May 25 '22 at 09:45
  • 1
    VBA isn't VBA.NET. The TPL is part of the .NET base library. There are ways to call .NET code from VBA, but those are involved (e.g. [this question](https://stackoverflow.com/q/37074533/4137916)). If you're going that far it's really worth considering inverting responsibilities and writing a client application that just imports the Excel data instead, or leverage Power Query/Power BI (which doesn't parallelize arbitrary code, but has good support for importing data in parallel). – Jeroen Mostert May 25 '22 at 09:52
  • Why do you want to use multithreading in Excel VBA in the first place? Excel calculations use all cores by default. Power Query also uses multiple cores. Power Pivot uses all cores *and* a columnar storage format to process more than 1M rows – Panagiotis Kanavos May 25 '22 at 10:53
  • I wanted to artificially create a modeless userform that blocks using async subs, but I'm just re-arraging the code in different subs and modules... given that I cannot – David May 26 '22 at 12:30

0 Answers0