I am currently writing around 200 Excel spreadsheets using Excel 2007 with C# COM Interop.
Unfortunately I need about 4 minutes to write these 200 sheets - each sheet has around 1000 rows with 8- 10 columns.
How can I speed up things?
My code looks like this basically:
var xlApp = new Excel.Application();
xlApp.DisplayAlerts=false;
foreach (x in z) {
var wb = xlApp.Workbooks.add(XLWBATemplae.xlWBATWorksheet);
var ws = (Worksheet)wb.Worksheets[1];
//fill data into sheet
wb.SaveAs(fileName);
wbClose();
}
clarification:I am filling every cell individually right now
I will try out some of the suggestions from you and will then accept the best solution.