Question about win32com in MS-Excel

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

Jiang Yu wrote: [SNIP]
Now, I have a question about use win32com moudle for MS-Excel. [SNIP]
This is the wrong place to ask about win32com (and the win32all package), Jiang. This list is to discuss the development of Python the language and not any extension modules. Try comp.lang.python, the newsgroup, or the win32all mailing list. -Brett
participants (2)
-
Brett C.
-
Jiang Yu