On 6/17/2020 2:46 PM, Itai Ben-Artzi wrote:
> Jim,
> Writing to Excel via the ActiveX is sloooooow.
> Writing a new Excel file as XML is blazingly fast and easy.
> To get a sample, try to save a file as XML.
> -Itai
>
Hi,
I acknowledge that Excel ActiveX is one of the slower ways to output
data however if one is populating an Excel spreadsheet with simple rows
of data it depends on how it is done as to performance.
I often create spreadsheets using ActiveX and initially create an array
with the data in my application and then do a single assign to an Excel
range. In looking at timings I can write out 10,000 data rows with 10
columns of assorted data types totaling 81 bytes per row in 2.58
seconds. If, however I write it out row by row the same data set would
take 31 minutes & 16 seconds.
In my mind 2.58 seconds is acceptable. Of course there are other
overheads such as file opening / closing as well as formatting data but
if one performs operations over the largest ranges possible as opposed
to individual cells, single rows or single columns there is a definite
performance penalty!
I still appreciate the ability to create well formatted spreadsheets
from scratch entirely within my application. Of course as MS Office
evolves one does not know how long they will support ActiveX.
That being said, my user base appreciates getting current reports in
Excel format as opposed to paper / PDF.
Regards... Jonathan
jonathan.leeming@familycentre.org
Edmonton, Alberta, Canada