I have an Excel file that I run a Python script on. The Excel file has external data connections that need to be refreshed before the Python script is run. The functionality
Adding this as an answer since this is the first Google link - the code in the first answer worked but has incorrect capitalization, it should be:
import win32com.client
import time
xlapp = win32com.client.DispatchEx("Excel.Application")
wb = xlapp.Workbooks.Open()
wb.RefreshAll()
time.sleep(5)
wb.Save()
xlapp.Quit()