代码如下:
import openpyxl

book = openpyxl.workbook()
sh = book.active

sh.title = '工资表'

book.save('ex02.xlsx')

解决:
只需要将workbook的k大写即可
book = openpyxl.Workbook()