hm
i tried it and i was actually able to do this :
_nearest = NearestObject [ SOME_OBJECT, "<TYPE>"]
Where <TYPE> is the exact type of unit but WEIRD..if the nearest is a "soldier", and my Type=SoldierW... no go.. you have to use SoldierWB. "man" won't work either...
It's not like CountType where you get all the subcategories... if you have a Jeep nearby and pass in "Car" you will get null. you have to pass in "Jeep".
I guess the same goes for the original problem where you tried to use "All"
Maybe write a neat script/function that uses an array of all the possible objects, and searches Nearest for each of the types and returns the nearest of those.
like such:
ObjectArray = ["man","SoldierW","SoldierWMG","OfficerW","OfficerE","Car","Jeep" ....
_i = 0
_j = count ObjectArray
_nearest = SOME_REALLY_FAR_OBJECT_PLACEHOLDER
#loop
_found = NearestObject[ OBJECT, ObjectArray select _i]
? (_found Distance OBJECT) < (_nearest Distance OBJECT) : _nearest = _found
_i = _i + 1
?( _i < _j ) : goto #loop
;;_nearest is now the nearest object of _any_ type