-1

I'm using code from Export several word documents appended in a single pdf file for reference.

As I was commented, the above procedure included a For Next which needs more times repeat.

The performance is low while:

(I was monitored the Task Manager's, Performance tab (CPU utilization) and the processes tab together.)

The overall CPU usage is -approximately- lower than 25%.

Why the running procedure have not using more CPU resources to increase performance and running faster?

Is it possible for us to perform consuming more CPU usage (100%) for increase the running software performance?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Tuberose
  • 434
  • 6
  • 24
  • 1
    performance are not only limited by CPU, you could be limited by memory usage/availability or by disk IOWait – TheOni Jan 03 '18 at 15:01
  • 4
    How many cores on your CPU? If the function is not multi-threaded, then it can only utilize at most 100% of one core. If there's IO involved (writing to disk), then the CPU will be idle while waiting for IO – dwilliss Jan 03 '18 at 15:01
  • regards, How can I made my procedure multi-threaded to using 100% of overall CPU utilization in VBA? Point is seems the code is not IO involved. Please visit my code. – Tuberose Jan 03 '18 at 15:10
  • My CPU has 2 cores. – Tuberose Jan 03 '18 at 15:12
  • 4
    Adding to @dwilliss observation - Pure VBA works in single-thread unless you use some com objects written in languages that can support multi-threading. – Pankaj Jaju Jan 03 '18 at 15:49
  • Related discussion: [stackoverflow.com/q/](https://stackoverflow.com/q/5721564/9075944) – Tuberose Jan 03 '18 at 16:31

1 Answers1

-2

VBA is single-threaded, so it will always use only a single core.

Robert Columbia
  • 6,313
  • 15
  • 32
  • 40
jkpieterse
  • 2,727
  • 1
  • 9
  • 18
  • 1
    Your answer really is a comment. – Tuberose Jan 07 '18 at 16:34
  • I find the difference between an answer and a comment isn't always that clear-cut. I posted this as an answer because there seemed to be discussion about whether or not VBA is mulit-threaded. IMO the thread needed a clear answer on that. – jkpieterse Jan 08 '18 at 06:26