[python-win32] IRTD Interface differences in Excel 2003 and Excel 2007

Christopher Nilsson chris at slort.org
Tue Nov 17 03:29:21 CET 2009


2009/11/17 Jack Cowden <cowdenj at gmail.com>:
> I set up Excel and the COM Interfaces
>
> EXCEL_TLB_GUID = '{00020813-0000-0000-C000-
> 000000000046}'
> EXCEL_TLB_LCID = 0
> EXCEL_TLB_MAJOR = 1
> #EXCEL_TLB_MINOR = 4   #Excel 2003
> EXCEL_TLB_MINOR = 6      #Excel 2007 via registry??? Is this correct?
>
> # Import the excel typelib to make sure we've got early-binding going
> on.

Oh dear, I hard-coded those typelib version numbers, didn't I?
Sorry. :)

By the looks of the docs ([1] & [2]), the IRTDUpdateEvent.UpdateNotify
hasn't changed -- wouldn't expect it to, though.

It has been a while since I was able to play with this stuff, but you
can confirm the version numbers with "makepy.py -i".  There's probably
a much nicer way for this to be done automatically via gencache now.

>     if self.__callback is None:
>      raise COMException(desc="Callback excel provided is Null")
>    try:
>      self.__callback.UpdateNotify()    <-----------------------THIS
> IS WHERE IT FAILS IN Excel 2007
>    except Exception, why:


Do you know if your RefreshData() routine gets called by Excel, before
your UpdateNotify() returns?  That would at least show UpdateNotify()
is pointing at the right place. Unfortunately I don't have a copy of
excel at the moment, so I can't check the order of events myself.

- Chris.

[1] Excel 2007 docs: http://msdn.microsoft.com/en-us/library/bb210024.aspx
[2] Excel 2003 docs:
http://msdn.microsoft.com/en-us/library/aa213639(office.11).aspx


More information about the python-win32 mailing list