1

我正在生成报告并希望在该选项卡失败时突出显示该选项卡。

import xlrd    
import xlwt

wb = Workbook()    
add_result = wb.add_sheet(req_id[req_num])    
wb.save("report_name.xls")
4

1 回答 1

0
xl = Dispatch( "Excel.Application")

xl.Visible = False

xlFile = "C:/tab_colour.xls"

wkb = xl.Workbooks.Open(xlFile)

sheet = xl.Worksheets.Item("SVP INFO")

sheet.Tab.Color = 255

wkb.Save()

wkb.Close()

xl.Quit()

xl = None
于 2013-05-30T13:04:42.443 回答