源代码如下:
import xlwings as xw app = xw.App(visible=True, add_book=False) app.display_alerts = False app.screen_updating = False wb = app.books.open(‘data.xlsx‘) sheet = wb.sheets[0] # 合并单元格 sheet.range(‘C8:D8‘).api.merge() wb.save() wb.close() app.quit()
现象:既不报错,也不执行,只是打开excel进程
【解决方法】库的函数变了,将merge 改为大写Merge