I have noticied that when using the PorgressBar. If I set the value to x, the value displayed is not immediately updated, it takes a small amount of time to draw it as the b
The problem is that you're in a single threaded program and the thread needs time to update the display.
Add the line
Application.DoEvents()
Before closing the UpdateProgress sub.
UpdateProgress
And you can get rid of the last two refresh.