SetScriptRunTimeout

SetScriptRunTimeout(ByVal SecondsFromNow As Long)

Allows a long-running script to 'forward' the script-timeout by the specified number of seconds. This only affects the current running script (thread) and is specifically meant for background tasks.

Public Sub MyLongDuringImport(pContext)
   Dim lBusy As Boolean  = True
   
   Do While Busy
       SetScriptRunTimeout 10 'Allow the current line to take up to 10 seconds to import.
       
       '.... Further logic comes here...
   Loop
End Sub

See also: