[python-win32] win32com calling IE: OLE error 0x800704a6

Kees van Schaik keesvanschaik at gmail.com
Tue Jan 5 03:28:47 CET 2010


(This is a cross post from the Python mailing list where unfortunately 
nobody responded. I would be very grateful if someone could give me some 
insights!)

Dear all,

I have written a Python script that runs on Windows XP with Python 2.5
and uses Internet Explorer to 'pretty print' some HTML output. This
has been working perfectly fine for a few years until recently IE was
upgraded to version 8. Now occasionally Python throws an error that
originates from the win32com.client.Dispatch() method and has
description 'OLE error 0x800704a6'. (Occasionally means that sometimes
it happens, sometimes it doesn't. I haven't been able to figure out
what the trigger exactly is.) The most recent version of win32com is
installed. Google on the error code didn't give me a lot of hits, and
no useful ones.

So, I was hoping somebody might be able to give me some pointers what
might be going on.

Here is the relevant (very straightforward) Python code:

import win32com.client

class IE:
    def __init__(self,url=None,vis=0,standalone=False):
        #Pas registerwaardes aan voor het printen:
        if not standalone:
            self.regOld=self.getRegValues()
            self.setRegValues
({'margin_left':'0.00000','margin_right':'0.00000','footer':'','header':''}) 

        #Start instantie van IE op:
        self.ie=win32com.client.Dispatch
('InternetExplorer.Application')
        self.ie.Visible = vis
        if url!=None:
            self.ie.Navigate(url)

and the class furthermore implements some methods to open & print some
HTML-file.

Unfortunately I only have a screenshot of the error:
http://tweakers.net/ext/f/cAdKjyjs7w4yZRu6s4RqNwjW/full.png 
<http://www.google.com/url?sa=D&q=http://tweakers.net/ext/f/cAdKjyjs7w4yZRu6s4RqNwjW/full.png&usg=AFQjCNEHr-QJwwMhc9AyTj-w46fL20XX9Q> 


Thanks in advance for your thoughts, Kees


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100105/36e2fa34/attachment-0001.htm>


More information about the python-win32 mailing list