none
Extensive Processing in Excel RRS feed

  • Question

  • Hi All,

    I am developing a VSTO for MS Excel and I have to do a lot of import/ export of enormous amount of  data and in this case Excel sometimes hangs so I want to improve this process. So I wanted to get some input from you guys what and how to do it. I was thinking of using the mixture of Parallel and Asynchronous Programming. 

    What are your thoughts, suggestion on it.

    Thanks,


    Attiqe Ur Rehman

    Saturday, March 1, 2014 2:28 PM

Answers

  • Hello Attiqe,

    Office applications use Single Threaded Apartments (STA). So, they are not thread safe. If you need to run another threads - don't use the Excel object model in them. As a workaround you may consider using the Open XML SDK for generating documents in another threads and then opening the ready-made documents in Excel.

    Finally, I'd suggest asking general Parallel and Asynchronous programming questions in the Visual C# or Visual Basic forums instead. There you will get the most qualified answers.


    Sunday, March 2, 2014 1:12 PM

All replies

  • Hello Attiqe,

    Office applications use Single Threaded Apartments (STA). So, they are not thread safe. If you need to run another threads - don't use the Excel object model in them. As a workaround you may consider using the Open XML SDK for generating documents in another threads and then opening the ready-made documents in Excel.

    Finally, I'd suggest asking general Parallel and Asynchronous programming questions in the Visual C# or Visual Basic forums instead. There you will get the most qualified answers.


    Sunday, March 2, 2014 1:12 PM
  • Eugene,

    That's exactly-Open XML SDK- what I am using now. Thanks for answer. 


    Attiqe Ur Rehman

    Sunday, March 2, 2014 7:31 PM