Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Office Interop Excel in a worker thread?

I'm exporting data form my C# application to an Excel file using Office Interop. Everything works fine, but the exports can be quite large and take some time to complete. I've searched around on the web and MSDN but haven't found much on running Interop calls in a thread. Are there any reasons I shouldn't put the export to Excel functionality into a background worker thread?

like image 508
nathan Avatar asked Sep 06 '25 21:09

nathan


1 Answers

So long as you're only calling into the Excel application from one thread, I don't expect that you would have any problems. I have written an application that automates Excel on a background worker thread in the same way you describe.

like image 57
Chris Spicer Avatar answered Sep 12 '25 07:09

Chris Spicer