April 13th, 2005, 07:37 PM
Hopefully this is the correct place to post this... my knowledge of COM is such that I'm not sure though.
Using win32client.Dispatch(), I can launch 'Excel.Application' and others, but cannot launch 'InternetExplorer.Application'. I don't get an error, but ie doesn't show up on the screen (even when I set visible = 1), and doesn't show up in running processes on the task manager. If I then try to do anything with ie, I get an exception.
If I have an internet explorer window open, though, I can use a Dispatch(clsid) kind of command to get a handle to one of the already open windows and navigate at will.
So... I've tried reinstalling win32 extensions to no avail. Anyone know why I can use python to launch other applications but not internet explorer?
April 14th, 2005, 05:04 PM
You can launch and control IE using COM, so I don't know why you are having a problem. Perhaps if you posted the exception traceback it will give a clue as to why it is not working.
You could also try PAMIE, a high level python wrapper around the COM interface to IE.
Dave - The Developers' Coach
Comments on this post
April 14th, 2005, 06:31 PM
Thanks for the reply. As for the traceback, I can't post it right now because I can't reproduce it. Now I'm getting some very weird behavior. For example, if I try to do the following in PythonWin:
>>> import win32com.client as c
>>> ie = c.Dispatch('InternetExploerer.Application')
>>> ie.visible = 1
with Windows Explorer closed, I get normal behavior, with a new Internet Explorer window opening. If I have Windows Explorer open, though, I do not get a new window. It appears at first glance as if nothing has happened. If I then type:
I get Yahoo opening in my windows explorer (_NOT_ internet explorer, windows explorer, with the folders and such.) One time, the browser information even got displayed in my PythonWin window.
This seems very weird, and I'm not sure if it is a windows problem or a python extensions problem... any pointers or advice would be appreciated.