I'm trying the following code from excel vba tutorial but it fails: the ProgressBat is not updating, plus UserForm1.ProgressBar1.Value = UserForm1.ProgressBar1.Value + 1
line gets highlited with an error `Run-time error 380. Invalid property value".
Sub ShowProgressBar()
Dim lAllCnt As Long
Dim rc As Range
lAllCnt = Selection.Count
UserForm1.Show
UserForm1.ProgressBar1.Min = 1
UserForm1.ProgressBar1.Max = lAllCnt
For Each rc In Selection
UserForm1.ProgressBar1.Value = UserForm1.ProgressBar1.Value + 1
Next
Unload UserForm1
End Sub
What may be wrong?