title: conditional enabling of activeX controls in excel vba
body: <p>Here is the situation:</p>
  
  <p>I have a sheet, on the sheet i have 4 command buttons as can be seen in the image below. From the image below you can see that the command buttons of the left has 2 colors, red and green. Initially, the 3 buttons would be red and the "Daily Cooling Load Vs Time" would be disabled. The "Daily Cooling Load Vs Time" should only enabled when all the 3 buttons on the left is green.</p>
  
  <p>So here is my problem:</p>
  
  <ol>
  <li>How do i initially disable the "Daily Cooling Load Vs Time" button?</li>
  <li>How do i conditioned so that:
  
  <ul>
  <li>when 2 out 3 button is red = "Daily Cooling Load Vs Time" is disabled</li>
  <li>when 1 out of 3 button us red ="Daily Cooling Load Vs Time" is disabled</li>
  <li>when all 3 is green= "Daily Cooling Load Vs Time" is enabled</li>
  </ul></li>
  </ol>
  
  <p>This is what I've tried so far:</p>
  
  <pre><code>Private Sub CommandButton4_Click()
      If CommandButton1.BackColor = 858083 Then
          CommandButton4.Enabled = False
      ElseIf CommandButton2.BackColor = 858083 Then
          CommandButton4.Enabled = False
      ElseIf CommandButton3.BackColor = 858083 Then
          CommandButton4.Enabled = False
      Else
          CommandButton4.Enable = True
      End If
  End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4oJgR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4oJgR.png" alt="enter image description here"></a> </p>