title: Application Defined or Object Defined Error in Excel with VBA
body: <p>VBE points to this bit of code which is causing the error:</p>
  
  <pre><code>Sheets("Topology").Range(Me.Get_Cell_Location).Interior.Color = RGB(255, 255, 255)
  </code></pre>
  
  <p>The whole function is defined as follows:</p>
  
  <pre><code>Public Function Colour_Me(choice As Integer) As Boolean
  
  If choice = 1 Then
  
      Debug.Print "Choice 1"
  
       If Me.Get_Enabled1 = True Or Me.Get_Enabled2 = True Or Me.Get_Enabled3 = True Then
          Sheets("Topology").Range(Me.Get_Cell_Location).Interior.Color = RGB(255, 255, 0)
          Colour_Me = True
       Else
          Sheets("Topology").Range(Me.Get_Cell_Location).Interior.Color = RGB(255, 255, 255)
          Colour_Me = False
       End If
  
  ElseIf choice = 2 Then
  
        Debug.Print "Choice 2"
  
       If Me.Get_Enabled1 = True Or Me.Get_Enabled2 = True Or Me.Get_Enabled3 = True Then
          Sheets("Topology").Range(Me.Get_Cell_Location).Interior.Color = RGB(0, 0, 255)
          Colour_Me = True
       Else
          Sheets("Topology").Range(Me.Get_Cell_Location).Interior.Color = RGB(255, 255, 255)
          Colour_Me = False
       End If
  End If
  
  End Function
  </code></pre>
  
  <p>The code in choice 1 seems to work alright, but choice 2 is giving me problems.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>Public Property Let Set_Cell_Location(location As String)
      cell_location = location
  End Property
  
  Public Property Get Get_Cell_Location()
      Get_Cell_Location = cell_location
  End Property
  </code></pre>