Hello, My name is Jiangyu, a Chinese man. You can call me Joe. I learn Python for only one year. I think it's a simple tools in my job some time. But in my country, Python is a new tools for many people. So If i have some problems on it, I found it's difficult to look for the answers。So I add the this mail list. Now, I have a question about use win32com moudle for MS-Excel. Question: I want to insert a file into a Excel sheet. But a exception occured in my code. Using VBA, I insert a file OK. And the processing in Python is equivalent in VBA. My environment: Python2.2.3 + win32com + Win2000 Server + Excel(Office XP) My Python code: >>> from win32com.client import Dispatch >>> excel = Dispatch("Excel.Application") >>> excel.Visible = 1 >>> excel.WorkBooks.Add() >>> cursheet = excel.ActiveWorkBook.ActiveSheet >>> oleobjs = cursheet.OLEObjects() >>> oleobjs.Add(Filename = r"c:\temp.txt") My VBA code: ActiveWorkbook.ActiveSheet.OLEObjects.Add Filename:="c:\temp.txt", Link:=False, DisplayAsIcon:=False So, If you know how to do it. please answer me. Thanks! joe 2004/8/13 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20040813/12d32d08/attachment.html
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4