What is the return type of bs.Cardinality()? I assume a Long?
Because you would then be narrowing the value (from 64bit to 32bit) you need to use CType (see link). Also, you must ensure that the Long value doesn't overflow the Integer value after narrowing because it would still fail otherwise.
CType Function (Visual Basic)
Above would maybe "fix" it, but... You need to ask yourself why you try to force the result type in a possible incompatible type? If the result of the function is a Long, why not store and use it as a Long? The person who created the function returns a Long value probably because the value could be very large. Because you simply check if the value is larger or equal to one you can easily use a Long or whatever the result type is without any problems. You should only use narrowing or widening if absolutely necessary.