Hello I'm trying to insert an object into an Excel sheet with the following code:
import win32com.client xlapp = win32com.client.Dispatch("Excel.Application") xlapp.Visible = 1 xlapp.Workbooks.Add() xlapp.ActiveSheet.OLEObjects.Add(FileName = "C:\\mytext.tx"', Link=False, DisplayAsIcon=False).Select But I get: AttributeError: 'function' object has no attribute 'Add' If I record a macro in Excel for what I want to do it comes out as: Sub Macro1() ' ' Macro2 Macro ' Macro recorded 30/10/2006 by Mark ' ' ActiveSheet.OLEObjects.Add(Filename:="C:\mytext.txt", Link:=False, _ DisplayAsIcon:=False).Select End Sub I'm a complete COM noob...what am I doing wrong? Cheers Mark WinXP SP2 Python 2.4.2 Pywin32 210 Excel 2003 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.17/505 - Release Date: 27/10/06 ___________________________________________________________ Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32