Optimized the loop to in cThemeWin7

Optimized the loop to prevent UBound calculation on each iteration