R
René
I got an "Overflow" error in one of my Progress Bar. When debugging the
code, I found out that I am able to reproduce the problem any time. The bar
width is 300 points and I want to show progress 200 times. The sample code
below reproduce the problem all the time. Can someone tell me what is wrong?
By the way, I am using Ms-Office Excel 2003 SP3.
Sub CheckOverflow()
Dim i As Integer
Dim r As Integer
r = 200
On Error Resume Next
For i = 1 To r
Err.Clear
Cells(i, 1) = 300 * (i - 1) / r
If Err Then Cells(i, 1) = Error(Err)
'Call MyMacro()
Next i
End Sub
code, I found out that I am able to reproduce the problem any time. The bar
width is 300 points and I want to show progress 200 times. The sample code
below reproduce the problem all the time. Can someone tell me what is wrong?
By the way, I am using Ms-Office Excel 2003 SP3.
Sub CheckOverflow()
Dim i As Integer
Dim r As Integer
r = 200
On Error Resume Next
For i = 1 To r
Err.Clear
Cells(i, 1) = 300 * (i - 1) / r
If Err Then Cells(i, 1) = Error(Err)
'Call MyMacro()
Next i
End Sub