Public Sub Import(ImportFile As String) As ResumableSub
ProgressDialogShow2("Importing...", False)
For j = 0 To ImportTable.RowCount - 1
'Prepare source data code
Sleep(0)
Next
ProgressDialogHide
Msgbox2Async("Do you want to import %1 rows?", "Import", "Yes", "", "No", Null, True) '< Crash when using Sleep(0) in the loop
Wait For Msgbox_Result (MsgResult As Int)
If MsgResult = DialogResponse.POSITIVE Then
'...
End If
End Sub