RE: win32com.client.Dispatch("WScript.Shell")

Discussion in 'Python' started by Tim Golden, Jul 16, 2004.

  1. Tim Golden

    Tim Golden Guest

    [Bala]
    > iam creating an instance for shell..while
    > doing sometimes iam getting an error called
    > pywintypes.com_error (-2147221008, 'CoInitialize has
    > not been called.', None, None)


    Usually indicates that you're running within some kind
    of threaded context. Try putting this before the call
    to Dispatch (having imported pythoncom, of course):

    pythoncom.CoInitialize ()


    TJG


    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star Internet. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
    Tim Golden, Jul 16, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefano Masini
    Replies:
    2
    Views:
    1,259
    Markus Wankus
    Mar 6, 2004
  2. selwyn
    Replies:
    0
    Views:
    500
    selwyn
    Jul 1, 2004
  3. Shawn Wheatley
    Replies:
    0
    Views:
    577
    Shawn Wheatley
    Jul 16, 2004
  4. Replies:
    2
    Views:
    1,281
  5. Replies:
    3
    Views:
    5,180
Loading...

Share This Page