MS COM early and late binding

Thomas Heller theller at python.net
Tue Apr 27 15:06:05 EDT 2004


OlafMeding at compuserve.com (Olaf Meding) writes:

> Is there a way to find out if I am using early or late binding given
> the reference ("excel" in the example below) returned by Dispatch()?
>
>>>> import win32com.client
>>>> excel = win32com.client.Dispatch('Excel.Application')
>

try:
    excel.visible
except AttributeError:
    print "late bound"
else:
    print "early bound"

Hint: Attributes are case sensitive when early bound ;-)

Thomas





More information about the Python-list mailing list