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?
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.
精彩评论