I'm wondering if the performance of the AutoFitColumns() method of hte WorkSheet object can be increased or if there is a work around to doing the autofit of columns faster.
I'm exporting about 40 thousand rows x 20 columns. Preparing the data (creating a data table, and importing from that data table plus adding ranges and styles for formatting) takes about 12-17 seconds. However, if I add a call to AutoFitColumns() then the process takes about 50-60 seconds, or nearly 4X slower. That is a pretty massive hit. I have profiled the application by using the instrumentation tools in visual studio and my only remaining bottle neck is the AutoFitColumns call.
Any suggestion is welcomed. Thanks.