Sounds like the macro process is making the app unresponsive. Not certain if this will help but have you considered adding DoEvents or Sleep (API call) in your long running process to yield control back to the OS? Sleep is an API call so you'd need to declare it in a module to use it.
DoEvents prevents the app from locking up, but it does use more CPUs so if it is in a loop I
would access it every once in a while (30% or less of the iterations). If it isn't a loop and you know where the bottlenecks are in your long running process you can call DoEvents after each long running process.
#If VBA7 And Win64 Then
' 64 bit Excel
Public Declare PtrSafe Sub Sleep Lib "kernel32" ( _
ByVal dwMilliseconds As LongLong)
#Else
' 32 bit Excel
Public Declare Sub Sleep Lib "kernel32" ( _
ByVal dwMilliseconds As Long)
#End If
Sleep API source
Then in your process
Sub SomeLongProcessWithDoEventsExample()
For i = 1 to 100000
'Some lengthy code
If i Mod 333 = 0 Then
DoEvents
End If
Next i
End Sub
Sub SomeLongProcessWithSleepExample()
For i = 1 to 100000
'Some lengthy code
If i Mod 333 = 0 Then
Sleep 1 * 1000 'Millseconds
End If
Next i
End Sub
I'd suggest setting the Application.ScreenUpdating = False then turn it back on after the process has finished, but it may make matters worse.
Update
Just read the comments that were entered while typing my answer. Another option instead of the messsage box would be to open the folder window where the files are being saved after all
the files have been created (replace Environ$("APPDATA") with save location):
Shell "explorer.exe" & " " & Environ$("APPDATA"), vbMaximizedFocus
OR open one of the PDFs:
Shell Environ$("COMSPEC") & " /c Start C:\SomeFile.pdf", vbMaximizedFocus
Another Option
I couldn't put this in the comments, because there was too much code, but Make an API call to MessageBox instead, but don't set owner of the message box (hWnd) set it at &H0 or &O0. The vbSystemModal should make it pop to the top. I don't know if it will allow you to select the excel application window after the user clicks okay:
MessageBox &O0, "My Message", "My Caption", vbOKOnly + vbSystemModal
#If VBA7 And Win64 Then
Public Declare PtrSafe Function MessageBox _
Lib "User32" Alias "MessageBoxA" _
(ByVal hWnd As LongLong, _
ByVal lpText As String, _
ByVal lpCaption As String, _
ByVal wType As LongLong) _
As Long
#Else
Public Declare Function MessageBox _
Lib "User32" Alias "MessageBoxA" _
(ByVal hWnd As Long, _
ByVal lpText As String, _
ByVal lpCaption As String, _
ByVal wType As Long) _
As Long
#End If