Property Get Progress As ISDBProgress
Dim Progress Set Progress = SDB.Progress Progress.Text = SDB.Localize("Exporting...") Progress.MaxValue = list.count for i=0 to list.count-1 '... some code here Progress.Value = i+1 next
Example: Persistent progress bar
Progress bar is shown when is instantied by the script, and is removed from window when no reference to its instance remains in memory. However, we can keep one reference to the bar inside SDB.Objects storage. This prevents the progress bar from being destroyed by garbage collector and thus it remains visible.
Removing persistent progress bar
Progress bar is removed after no variables are pointing to the object. So overwriting the reference to the progress bar inside SDB.Objects with null/Nothing causes the progress bar dissapear. However, scripting engine does perform garbage collection only from time to time, so we need to call garbage collector explicitly or wait few seconds till progress bar disappears.