I just recently installed ActivePython 2.4.2 build 245 on XP sp2 and none of the programs that is use for automating COM objects seem to work.  The script is running on the local machine trying to operate local COM objects.

 

Sample script:

 

import win32com.client

import win32api

 

def _BusyWait(self):

            win32api.Sleep(100)

            while self.Busy:

                        win32api.Sleep(100)

                        print 'Busy:',

            win32api.Sleep(100)

            print '\n'

            print 'Finished Script'

 

path = 'http://www.foxnews.com'

endline = '\r\n'

shell = win32com.client.Dispatch('WScript.Shell')

shell.Run('IEXPLORE')

win32api.Sleep(5000)

ie = win32com.client.GetActiveObject('InternetExplorer.Application')

print ie.LocationURL

shell.AppActivate('ClayNet')

win32api.Sleep(1000)

shell.SendKeys('\t')

win32api.Sleep(100)

shell.SendKeys(path)

win32api.Sleep(100)

shell.SendKeys(endline)

_BusyWait(ie)

 

The error I get is:

 

At the GetActiveObject line I get “Operation Unavailable”

The Shell part and the win32api sleep function seem to work normally.  I get this same behavior from the wmi interface COM objects.

 

Question:  What permissions need to be set to these types of objects as well as Word, Outlook, Excel, Power Point etc.?

 

Ronnie Jones

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to