I need to be able to refresh an excel workbook, to make sure all the formulas have been calculated before trying to read data from it. I am using this code to do the update:
xlapp = win32com.client.DispatchEx("Excel.Application")
wb = xlapp.Workbooks.Open(<path_to_excel_workbook>)
wb.RefreshAll()
xlapp.CalculateUntilAsyncQueriesDone()
wb.Save()
xlapp.Quit()
But it is extremely slow, in fact, I have been running it for several minutes and it still hasn't completed. Is there a faster way to refresh all of the formulas?
question from:
https://stackoverflow.com/questions/65884348/refreshing-an-excel-workbook-takes-a-very-long-time 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…