Python COM and Threads

Olaf Meding olafmeding at
Thu Oct 14 21:56:05 CEST 2004

Looks like Python can not make COM calls from a thread?  Here is the
error message I get: 'CoInitialize has not been called.'

Here is the code:

  import threading
  import win32com.client

  class Thread1(threading.Thread):
    def run(self): 
        print 'thread 1'
        userInterface = win32com.client.Dispatch('Excel.Application')	

  def main():
    t1 = Thread1()

  if __name__ == '__main__':

Thanks much for your help on this.


More information about the Python-list mailing list