python无法打开文档_win32com Excel。应用程序无法打开任何文档
這是上周的工作,但由于某種原因,它今天停止工作,也許是因?yàn)樾履?#xff1f;def remove_strikethroughs(xlsx):
excel = win32com.client.Dispatch('Excel.Application')
xl = pd.ExcelFile(xlsx)
sheet_names = xl.sheet_names
for sheet in sheet_names:
if any(tab in sheet for tab in tabs_used):
#print (sheet)
wb = excel.Workbooks.Open(xlsx)
ws = wb.WorkSheets(sheet)
for cell in ws.Range('A5:B150'):
if cell.Font.Strikethrough == True:
cell.value = '[MDU]' + str(cell)
wb.Save()
wb.Close()
excel.Visible = True
excel.DisplayAlerts = True
excel.Application.Quit()
我收到以下錯(cuò)誤消息:"AttributeError: '' object has no attribute 'open'"
有人能幫忙嗎?
謝謝!
總結(jié)
以上是生活随笔為你收集整理的python无法打开文档_win32com Excel。应用程序无法打开任何文档的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 只有一个分区怎么克隆 仅有1个分区如何克
- 下一篇: 戴尔笔记本怎么优盘启动bios设置 戴尔