from win32com.client import Dispatch def just_open(filename='文件的绝对路径'): xlApp = Dispatch("Excel.Application") xlApp.Visible = False xlBook = xlApp.Workbooks.Open(filename) xlBook.Save() xlBook.Close()
pip install pywin32
先将文件进行打开,然后再进行读取。
参考 https://cloud.tencent.com/developer/article/1742134
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/273800.html