<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-2022-jp">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>Hello, My name is Jiangyu, a Chinese man<FONT
face=Arial></FONT>. You can call me Joe.</FONT></DIV>
<DIV><FONT face=Arial>I learn Python for only one year. I think it's
a simple tools in my job some time.</FONT></DIV>
<DIV><FONT face=Arial>But in my country, Python is a new tools for many people.
So If i have some </FONT></DIV>
<DIV><FONT face=Arial>problems on it, I found it's difficult to look for the
answers。So I add the this mail list.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Now, I have a question about use win32com moudle for
MS-Excel.</FONT></DIV>
<DIV><FONT face=Arial>Question: I want to insert a file into a Excel
sheet. </FONT><FONT face=Arial> But a exception occured in my
code.</FONT></DIV>
<DIV><FONT
face=Arial>
Using VBA, I insert a file OK. And the processing in Python is equivalent
in VBA.</FONT></DIV>
<DIV><FONT face=Arial></FONT><FONT face=Arial></FONT><FONT
face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>My environment: </FONT><FONT face=Arial>Python2.2.3 +
win32com + Win2000 Server + Excel(Office XP)</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>My Python code:</FONT></DIV>
<DIV><FONT face=Arial>>>> from win32com.client import
Dispatch<BR>>>> excel = Dispatch("Excel.Application")<BR>>>>
excel.Visible = 1<BR>>>> excel.WorkBooks.Add()<BR>>>> cursheet
= excel.ActiveWorkBook.ActiveSheet<BR>>>> oleobjs =
cursheet.OLEObjects()<BR>>>> oleobjs.Add(Filename =
r"c:\temp.txt")</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>My VBA code:</FONT></DIV>
<DIV><FONT face=Arial>ActiveWorkbook.ActiveSheet.OLEObjects.Add
Filename:="c:\temp.txt", Link:=False, DisplayAsIcon:=False</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>So, If you know how to do it. please answer me.
Thanks!</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>joe</FONT></DIV>
<DIV><FONT face=Arial>2004/8/13</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV></BODY></HTML>