I have a method in my VBA code
Sub SaveCopyOfFile(sourcePath As String, destinationPath As String)
Set FSO = New fileSystemObject
FSO.CopyFile sourcePath, destinationPath
End Sub
which will take a long time if the user select a location on the network. This causes Excel to think that its not responding even if it's working fine.
I know that this process will take a very long time and I don't want users to panic and force close the application in the middle of this. How can I make sure that Excel does not change its display to "Excel is not responding".
If someone needs to know why this would take a long time:
- Report template file could be located on the network drive.
- The macro creates an excel report and the user can choose its destination to be on the network
- The macro downloads images from the network and inserts them into the newly created excel file.
I've added a lot of code to help mitigate this such as doing everything local and only transferring the completed report to the desired destination after everything is done. The last step causes the Excel application to think that it has stopped responding.
Note if left alone the task will complete and Excel will revert back to normal from its "Not Responding" state.