embedding a jpg in an excel spreadsheet
Raymond Hettinger
othello
Wed Feb 27 00:12:41 EST 2002
"James Strater" <James.Strater at exolink.com> wrote in message
news:mailman.1014755052.28857.python-list at python.org...
> Hello,
>
> I am creating an excel spreadsheet using python win32com.client. This all
> works fine.
>
> In the first row/cell of the spreadsheet, I want to embed a logo which is
> stored in a a jpg file. Can anyone suggest how to do this?
from win32com.client.dynamic import Dispatch
xl = Dispatch( 'Excel.Application' )
xl.Range("B5").Select
xl.ActiveSheet.Pictures.Insert("C:\ Pictures\corplogo.jpg")
>
> Also, I need to change the cell background colors on some rows. Again,
any
> suggestions?
xl.Range("A1").Select
xl.Selection.Interior.ColorIndex = 8
>
> Thanks,
>
> James
>
The easiest way to devine the Excel object model is to turn-on the macro
recorder, perform the steps manually, stop the recorder, edit the macro, and
observe the calls that were made.
Raymond Hettinger
More information about the Python-list
mailing list