Does anybody here know how to get VBA to run multiple threads? I am using Excel.
相关问题
- How to let a thread communicate with another activ
- Excel sunburst chart: Some labels missing
- Why it isn't advised to call the release() met
- ThreadPoolTaskScheduler behaviour when pool is ful
- Error handling only works once
相关文章
- Difference between Thread#run and Thread#wakeup?
- Java/Spring MVC: provide request context to child
- Threading in C# , value types and reference types
- RMI Threads prevent JVM from exiting after main()
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- Unregister a XLL in Excel (VBA)
I know the question specifies Excel, but since the same question for Access got marked as duplicate, so I will post my answer here. The principle is simple: open a new Access application, then open a form with a timer inside that application, send the function/sub you want to execute to that form, execute the task if the timer hits, and quit the application once execution has finished. This allows the VBA to work with tables and queries from your database. Note: it will throw errors if you've exclusively locked the database.
This is all VBA (as opposed to other answers)
The function that runs a sub/function asynchronously
The module of the form required to achieve this
(form name = MultiThreadingEngine, doesn't have any controls or properties set)
Implementing support for parameters should be easy enough, returning values is difficult, however.