controlling Excel2000 with COM

Hirsch, John JohnH at PHM.GOV.AU
Mon Apr 3 03:38:07 CEST 2000


Christer Fernstrom wrote:

	I tried the most obvious thing with COM with Excel 20000 in Windows
2000 (p.
	67 in "Programming on 32")

	>> import win32com.client
	>> xl = win32com.client.Dispatch("Excel.Application")
	  -- This launches Excel (as verified with the windows task manager)
	>> xl.visible =1 (I also tried to capitalise Visible)
	Result:
	Traceback (innermost last):
	  File "<pyshell#2>", line 1, in ?
	    xl.visible =1
	  File "D:\tools\Python\win32com\client\dynamic.py", line 453, in
	__setattr__
	    raise AttributeError, "Property '%s.%s' can not be set." %
	(self._username_, attr)
	AttributeError: Property 'Excel.Application.visible' can not be set.

	Anybody got a clue? Is this a problem related to Office2000?

	    christer
____________________________________________________________________________
______________

This works for me.

>>> import win32com.client
>>> xl = win32com.client.Dispatch("Excel.Application")
>>> xl.Visible = 1

Must be capital 'V'.

john






More information about the Python-list mailing list