[python-win32] RE: python excel

Sayed A. Kooshesh sakoosh@uark.edu
Wed, 27 Feb 2002 13:41:38 -0600


yeah,
no problem
but you should really submit this to the list next time, I'm a newbie at
this

###start code
xl=win32com.client.Dispatch("Excel.Application")  #call the Excel object
wb=xl.Workbooks.Open(file,0) #replace file with the excel file
sh=wb.Worksheets(1) #open the appropriate worksheet
sh.Shapes.AddPicture(imagefile,0,1,541.5,92.25,192.75,180)  #replace image
file with the image

#the arguments go like this:
#imagefile - the location of the image file
#I'm not totally sure, but I believe in some versions of excel, the image
file has to be in bitmap
#format...
#linktofile - 0 for no, 1 for yes
#savewithdocument - 0 for no, 1 for yes
#left - how far from the left of the window
#top - how far from the top of the window
#width - image width
#height - image height




### end code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What's the difference between fate and destiny?

Your destiny is determined by your actions.
Your fate is determined by your destiny.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


-----Original Message-----
From: James Strater [mailto:James.Strater@exolink.com]
Sent: Wednesday, February 27, 2002 1:39 PM
To: 'sakoosh@uark.edu'
Subject: python excel


I saw a message from you on a python newsgroup.

I am trying to take a jpg file and insert it into an excel spreadsheet as a
picture object using python.  Do you have some code you might share?

Thanks so much,

James