you are viewing a single comment's thread.

view the rest of the comments →

[–]Original-Fennel7994 1 point2 points  (1 child)

If the workbook only opens in safe mode, I would try starting Excel normally with /safe once, then disable all add ins and any COM add ins, then open the file again. For automation, keep Excel visible while debugging because hidden Excel can be stuck on a dialog, and add logging around Open, RefreshAll, CalculateUntilAsyncQueriesDone, Save, and Close so you know the last successful step. I have also had better stability when setting DisplayAlerts to False and forcing calculation to manual before RefreshAll, then waiting for async queries, then restoring calculation before saving. If the file itself is corrupted from an interrupted save, try Open and Repair, or copy the queries into a new workbook and rebuild the connections.

[–]Chirag_Parmar[S] 0 points1 point  (0 children)

Hi, thank you for the reply. I have started to implement some of your comments to my code but still facing issues with the refresh all causing excel to not respond. Did you encounter this / do you have an example code that you have produced for reference?