Win32COM and Excel Charts

cheeseballs at my-deja.com cheeseballs at my-deja.com
Fri Jun 23 19:05:41 EDT 2000


In article <8itpcd$ism$1 at nnrp1.deja.com>,
  cheeseballs at my-deja.com wrote:
> Hi, has anyone successfully created an embedded chart within an Excel
> Worksheet using win32com.client?
>
> I'm able to create a chart in it's own Sheet with the following:
> >>> xlapp=win32com.client.Dispatch("excel.application")
> >>> xlapp.Visible=1
> >>> xlchart=xlapp.Charts.Add()
>
> then I try to add a chart in the active worksheet...
> >>> xlsheet=xlapp.Worksheets(1)
> >>> xlchartobj = xlsheet.ChartObjects.Add(10,10,100,100)
>
> but it doesn't look like Add is a method of the ChartObjects
> collection...
> Any ideas?
> Thanks, Drew
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

I'll answer my own question, I was missing the little parenthesis':
>>> xlchartobj = xlsheet.ChartObjects().Add(10,10,100,100)
                                     ^^


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list