'return the cell value
Sub PoiGetCell(cell As PoiCell, bFormulasAsValues As Boolean) As String
If cell.IsInitialized = True Then
Select Case cell.CellType
Case cell.TYPE_NUMERIC
Return cell.ValueNumeric
Case cell.TYPE_STRING
Return cell.ValueString
Case cell.TYPE_FORMULA
If bFormulasAsValues = False Then
Return cell.ValueFormula
Else
Return cell.Value
End If
Case cell.TYPE_BLANK
Return ""
Case cell.TYPE_BOOLEAN
Return cell.ValueBoolean
Case cell.TYPE_ERROR
Return ""
Case Else
Return cell.Value
End Select
Else
Return ""
End If
End Sub