title: Why does "If Value is Nothing" throw "Object Required (Error 424)"
body: <p>The following code throws <code>Object Required (Error 424)</code> at the if statement comparing with <code>Nothing</code> independent of the value given. Why?</p>
  
  <pre><code>Public Function SqlizeCellValue(ByVal Value As Variant) As Variant
      If Value Is Nothing Then
          SqlizeCellValue = Nothing
      ElseIf Value = Null Then
          SqlizeCellValue = Null
      ElseIf Value = "" Then
          SqlizeCellValue = Null
      ElseIf Value = "0" Then
          SqlizeCellValue = Null
      ElseIf Value = "---" Then
          SqlizeCellValue = Null
      ElseIf LCase(Value) = "n.c." Then
          SqlizeCellValue = Null
      Else
          SqlizeCellValue = Value
      End If
  End Function
  Public Sub TestSqlizeCellValue()
      Debug.Assert SqlizeCellValue("") Is Null
      Debug.Assert SqlizeCellValue("0") Is Null
      Debug.Assert SqlizeCellValue("---") Is Null
      Debug.Assert SqlizeCellValue(Nothing) Is Nothing
      Debug.Assert SqlizeCellValue(Null) Is Null
  End Sub
  </code></pre>