asp.net, Threading and Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wanted to use a new Thread to open Excel.Application in my web project and
it gave access denied. If I do not use a new thread, i.e NO thread.start(),
then this Excel.Application instantiation is fine.

Any ideas ? Thanks
 
¤ I wanted to use a new Thread to open Excel.Application in my web project and
¤ it gave access denied. If I do not use a new thread, i.e NO thread.start(),
¤ then this Excel.Application instantiation is fine.
¤
¤ Any ideas ? Thanks

It's probably because Office apps are not designed to be used with multiple threads. They operate
off the main UI thread which runs in an STA (single-threaded apartment).

This is the main reason why Microsoft does not support the use of automation with Office
applications from unattended non-UI processes such as web server or service based applications.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top