Refresh Excel External Data with Python

前端 未结 5 1086
北荒
北荒 2020-11-29 08:39

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

5条回答
  •  失恋的感觉
    2020-11-29 09:13

    A small note, but important one. All the codes above are correct, but it will raise the issue with permission Err 13 because the file is only being saved, not closed as well.

    add wb.Close() after save, otherwise the openned Excel will remain in the background app, and if you work with 500 of those, you might get a bit into troubles

提交回复
热议问题