At runtime I get this error on the 4th line, "if ActiveOval.Visible = False Then"
Error Message="Object reference not set to an instance of an object."
There will ALWAYS be ActiveOval1 thru ActiveOval10
I don't know why the error occurs or how to overcome it.
OvalOK = 0
For i As Integer = 1 To 10
Dim ActiveOval As Control = GetControlByName("OvalShape" & i)
If ActiveOval.Visible = False Then
OvalOK = OvalOK + 1