1

I'm writing a C# program that outputs thousands of lines into an excel spreadsheet using the Excel 12.0 Object Library. I noticed that it was generally pretty slow, so I timed it with the Stopwatch class and found out each write to a cell was taking around 4 million ticks.

  1. Is this speed normal?
  2. Is there a faster alternative?

Edit: 4 not 100 million

Andrew
  • 2,519
  • 6
  • 29
  • 46
  • My prior experience has shown this method to be painfully slow. is this just raw data? Is outputting as a CSV an option? – Bob Probst Jun 23 '11 at 19:59
  • This may be a stab in the dark, but I have found if you are forcing any sort of specific font or style, it can slow things down significantly. – Yetti Jun 23 '11 at 20:01
  • The only formatting I'm doing is changing the number formatting to text – Andrew Jun 23 '11 at 20:05

2 Answers2

0

Yes, this speed is normal - it is painfully slow.

There are faster alternatives available. I have used SpreadsheetGear, which I found easy to use and much faster.

user816098
  • 262
  • 3
  • 14
0

Maybe look at the question. Create excel xls and xlsx a lot of people liked the Epplus library. I just started with it and it seems good.

Community
  • 1
  • 1
MikeJ
  • 14,430
  • 21
  • 71
  • 87