'Saving progress bar not disappearing

I have come across this issue in a few different Macros and I have not figured out the solution.

Basically I have some scripts that are running in a workbook and in that workbook I have a sheet where I write what actions have been performed in the script. I then need to save only the sheet with the log info into a new workbook. When the saving is in progress an info window will appear with a progress bar. Now it happens that this info window is not disappearing, even if the file has already been saved, so then my macro is not continuing to execute, instead it is waiting for the info window to disappear.

The issue does not alway appear. If I for example execute the below code standalone, then the info window will disappear quickly. But when I am using the same code for saving larger scripts then it can happen that the info window will not disappear.

Does anybody know what the underlying issue could be? Is there some way to not diplay this info window, or a way to click cancel if it has been visible for example 5 seconds?

The location is a network drive, so maybe this could be the reason? But I dont understand why it does not close the window even if the file has been saved already.

Dim ws1 As Worksheet
Set ws1 = Workbooks("Main.xlsm").Worksheets("log")

Dim filepath As String
filepath = "\\fisv00j-55\UiPath\UiPath_PEC\InputFilesForRobots\PEC-TR-088-BankStatementPostings\"

ws1.Copy
ActiveWorkbook.SaveAs Filename:=filepath & "log.xlsx"
ActiveWorkbook.Close

Saving info window/progress bar



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source