Embedding a chart in excel

Stephen Boulet Stephen.Boulet at no.spam.motorola.com
Fri Aug 22 12:50:00 EDT 2003


There seems to be a problem with UseExcel.setcell:

 >>> a.setcell(sht1.Name,1,(1,1))
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "excel_from_google.py", line 139, in setcell
     sht.Cells(row, col).Font.FontSize = fontSize
   File "C:\Python23\lib\site-packages\win32com\client\dynamic.py", line 
504, in __setattr__
     raise AttributeError, "Property '%s.%s' can not be set." % 
(self._username_, attr)
AttributeError: Property '<unknown>.FontSize' can not be set.

srijit at yahoo.com wrote:
> Hello,
> Refer the following link:
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=6eaef82c8c0d9548&seekm=37ee60c8.0308202344.f470d26%40posting.google.com#link11
> 
> Does it help you? If it doesn't, let me know what improvements are
> required.
> 
> Regards,
> Srijit
> 
> Stephen Boulet <Stephen.Boulet at no.spam.motorola.com> wrote in message news:<bi3gg3$8pk$1 at newshost.mot.com>...
> 
>>I'm having trouble scripting Excel to embed a chart from python.
>>
>>Say I have created a sheet object and a workbook object, "xlSheet" and 
>>"xlBook".
>>
>>Creating a chart in front of my sheet is as easy as:
>>
>>xlSheet.Select()
>>xlChart = xlBook.Charts.Add()
>>
>>Now how do I tell it to go embed itself in my sheet? In VBA, it might be 
>>something like:
>>
>>xlChart.Location Where:=xlLocationAsObject, Name:=xlSheet.Name
>>
>>Thanks.
>>
>>(Is there a newsgroup/list with more of a focus on issues like this than 
>>c.l.py?)
>>
>>-- Stephen





More information about the Python-list mailing list