0
ws.cell(row=greenBegin+1, column=3).style.fill.fill_type = 'solid'
ws.cell(row=greenBegin+1, column=3).style.fill.start_color.index = '0000FF'
ws.cell(row=greenBegin+1, column=3).style.fill.end_color.index = '0000FF'
我試圖設置使用此代碼穩定的綠色單元格的填充,但我總是得到「AttributeError錯誤:無法設置屬性」當我運行的代碼。我嘗試過不同的造型方法,但是關於這個庫AFAIK並沒有太多的信息,因爲我用它來做一個工作項目,這至少是很麻煩的。OpenPyXL:AttributeError的嘗試時設置填充
我不使用Python,但快速搜索產生[這](http://stackoverflow.com/questions/30484220/python-fill-cells-with-colors- using-openpyxl)希望這有助於? –
另一[ONE](http://stackoverflow.com/questions/30904765/how-do-i-color-fill-in-a-specific-excel-cell-using-openpyxl) –
或[THIS](http: //stackoverflow.com/questions/8440284/setting-styles-in-openpyxl) –