0

I used VBA under Excel in order to treat some data (input is .XML files). XML file size is around 30MB and i have some computations on each entry of the file. My computer ran on Windows 7 64 bits under Core i5 (4 core when I look in task manager) with 4GB of RAM

My question is: When my VBA script is running, why CPU usage not increase close to 100% ?? I can understand, may be, Excel do not use all the 4 cores of the CPU but why not on 1 core ? (I have already tryed to change priority to 'real time')

I'm trying to find some solutions to speed up my script execution... I have already tried to imporde my code with tips like : http://blogs.office.com/2009/03/12/excel-vba-performance-coding-best-practices/

Rework my design for splitting my script in thread to make tasks in parallel is the only solution ?

Thanks guys ;-)

maxic31
  • 1
  • 1

1 Answers1

0

VBA runs in a single threaded apartment: yes that is wasteful when it comes to multi-core machines.

To benefit from parallelisation, one way is to (i) switch on Excel's multithreaded calculation mode and (ii) switch your architecture to using an xll rather than VBA.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483