View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech[_2_] Jim Rech[_2_] is offline
external usenet poster
 
Posts: 533
Default Automation performance degradation in Excel 2007

Significantly slower performance with Excel 2007 is a frequent lament here.
I had not seen Excel 2007 do anything in less than twice the time it took
Excel 2003, not that I've spent my life doing time trials.

I decided to see how automation via a simple VBS script compared. To my
surprise 2007 was only about 50% slower. Here's the script (save in a text
file with a VBS extension):

Dim XL
set XL = GetObject(,"Excel.Application")
xl.screenupdating=false
st = timer
for counter = 1 to 5000
xl.cells(counter,1).value = counter
next
msgbox timer-st
xl.screenupdating=true

You have to have one instance of Excel open (e.g., either 03 or 07), with a
workbook present when you run this. This isn't great performance but it's
way quicker than you're seeing. One caveat - I'm using Excel 2007 with SP1.
No idea if the patch helped.

--
Jim
"John Austin" wrote in message
...
Hello Jialiang,

I have read the article that you mentioned. The problem that I have is not
with the calculation of the workbook, it is the time taken to insert data
in
the workbook (with automatic calculation turned off) from a VB application
via OLE automation. This is the process that will take over 5 hours
instead
of 1.5 hours.

--
John Austin


"Jialiang Ge [MSFT]" wrote:

Hello John,

From your post, my understanding on this issue is: you wonder why the
automation of Excel 2007 looks slower than that of Excel 2003, and how to
improve its performance. If I'm off base, please feel free to let me
know.

According to the MSDN article
http://msdn2.microsoft.com/en-us/library/aa730921.aspx (Improving
Performance in Excel 2007), the performance issue is caused by the
increased limits in Excel 2007. The Excel 2007 "Big Grid" increases the
maximum number of rows per worksheet from 65536 to over 1 million, and
the
number of columns from 256 (IV) to 16384 (XFD) (See
http://msdn2.microsoft.com/en-us/lib...007excelPerf_B
igGridIncreasedLimitsExcel). When we create large worksheets, it is easy
to
build them in a way that causes them to calculate slowly. However, by
using
a straightforward set of techniques, we can speed up most
slow-calculating
worksheets by a factor of 10 or 100:
http://msdn2.microsoft.com/en-us/lib...007excelPerf_M
akingWorkbooksCalculateFaster (Excel 2007 Performance Improvements)
http://msdn2.microsoft.com/en-us/lib...007excelPerf_F
indingPrioritizingCalculationBottlenecks (Finding and Prioritizing
Calculation Bottlenecks)
http://msdn2.microsoft.com/en-us/lib...007excelperf_E
xcelPerformanceImprovements (Excel 2007 Performance Improvements)
http://msdn2.microsoft.com/en-us/lib...007excelperf_T
ipsOptimizingBottlenecks (Tips for Optimizing Bottlenecks)

For instance, we could utilize the new feature of Excel 2007:
multi-threaded calculation to improve the calculation speed, or
temporarily
set the calculation mode as "Manual" so that the formulas are only
recalculated when you request it. You can also apply these techniques as
you design and create worksheets to ensure that they calculate quickly.

The Excel development team has been spending a lot of time tuning Excel
2007's calculation performance to make it as fast as possible. (See:
http://blogs.msdn.com/excel/archive/...28/540939.aspx Help us make
Excel 2007 faster¡*). Here are a few more posts about Excel performance
from Excel team blog:
http://blogs.msdn.com/excel/archive/...03/488822.aspx Multi-threaded
calculation in Excel, or "how calculation can become much faster in Excel
12"
http://blogs.msdn.com/excel/archive/...ce-new-whitepa
per-available.aspx Excel Performance - New Whitepaper Available
http://blogs.msdn.com/excel/archive/...26/474258.aspx Some other
numbers ...

Please try the above techniques according to your specific situation, and
let me know if they can help you improve the performance. For any other
concerns or questions, please feel free to let me know.

Regards,
Jialiang Ge , remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time"
to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.