<every few seconds it touches the Excel status bar to post its progress>
That's one of the many tasks you leave to the OS; presentation.
On my Pentium4 system (Hyperthreading, not real dual core), if I run VBA to do multiplications in a loop, the task manager sees
two processors. Excel takes 50% of the available CPU (that is one full thread) and System Idle Process takes the other half.
Running a worksheet-intensive file in Excel 2007, which does benefit from multiple CPUs or threads (but not in VBA), I see the
Excel process going up to 70% and sometimes more.
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
| Hmmm... I've got a friend with a dual core Intel setup so I guess I'll ask
| him to try it on his machine to see what he gets. As the VBA is
| specifically written for a speed test it does absolutely nothing but
| arithmetic calculations and every few seconds it touches the Excel status
| bar to post its progress. No disk usage or paging or display usage or
| anything I can think of that should use OS support.
|
| Thanks Bob.
|
| Bill
| --------------------------
| | > That isn't what I suggested.
| >
| > When the VBA executes, all of the pure VBA will be in one processor. But
| > it isn't all done internally within VBA, some things will be handed off to
| > the OS to do, it is this that I am suggesting may well be the another
| > processor.
| >
| > --
| > ---
| > HTH
| >
| > Bob
| >
| > (there's no email, no snail mail, but somewhere should be gmail in my
| > addy)
| >
| >
| >
| > | >> No, that doesn't seem to be the case. I have nothing else running on the
| >> machine, so the CPUs are loafing along at under 2% until I hit the button
| >> to execute my VBA. At that point they both jump up to around 50%.
| >>
| >> And I can't believe the computer is smart enough to send off to two CPUs
| >> the VBA I wrote even if it could do so. There is no spreadsheet recalc
| >> or anything going on, just a single thread of numerically intensive
| >> calculation.
| >>
| >> Bill
| >> ---------------------------------------------------------------------------------------------
| >> | >>>I don't think Excel is, but don't forget, lots of the work is off-loaded
| >>>to
| >>> the OS. It is probable that Excel is running in one, the OS tasks in
| >>> another.
| >>>
| >>> --
| >>> HTH
| >>>
| >>> Bob Phillips
| >>>
| >>> (there's no email, no snail mail, but somewhere should be gmail in my
| >>> addy)
| >>>
| >>> | >>>> Using Excel 2003, I have a VBA speed test I wrote which takes about a
| >>> minute
| >>>> on my old Celeron XP-Home system. And if I watch CPU usage while it
| >>>> runs,
| >>>> Task Manager sits pegged at 100% while it runs which is what I expect.
| >>>>
| >>>> I just ran it on an AMD X2 4200 though with XP-MediaCenter which runs
| >>>> it
| >>> in
| >>>> half the time. What surprises me though is that Task Manager tells me
| >>> that
| >>>> *both* CPUs run at about 50% each when the program runs. What I
| >>>> expected
| >>>> was to see one CPU pegged out at 100% and the other loafing along doing
| >>>> nothing.
| >>>>
| >>>> Is Excel 2003 written to take advantage of dual core? I didn't think
| >>>> it
| >>>> was. And if it is, why does it only drive the CPUs at 50% rather than
| >>> 100%?
| >>>>
| >>>> Thanks...
| >>>>
| >>>> Bill
| >>>>
| >>>
| >>>
| >>
| >
| >
|