Hello guys!!
I'm using a UserForm to make a loading bar to notify the user on the remainig time for the macro to end but even with "ScreenUpdate = False", my UserForm still flickering.
When the code is running, both my Excel and Visio are hidden. Only the UserForm is shown and at every step my loading bar is incremented, the UserForm's window become active which makes the PC unusable.
Does someone has a solution?
Here's an exemple of my code :
Sub main()
Application.ScreenUpdating = False
'code (loop)
progression = progression + 1
ProgressBar.barre.Width = progression
ProgressBar.Show 0
next
'code (loop)
progression = progression + 1
ProgressBar.barre.Width = progression
ProgressBar.Show 0
next
AppVisio.ActiveDocument.SaveAs
progression = 150
ProgressBar.barre.Width = progression
ProgressBar.Show 0
Unload ProgressBar
Application.ScreenUpdating = True
AppVIsio.Quit
End Sub
Sub barre_progression()
ProgressBar.barre.Width = progression
DoEvents
ProgressBar.Hide
End Sub
Private Sub Workbook_BeforeClose()
Application.Visible = False
main
ThisWorkbook.Saved = True
Application.Quit
Thanks!