The first problem with the counts is actually an easy one.

Try this instead: ? "Number of Printers: " + (val(ubound($array)) + 1)

The second problem appears to be a com error: try replacing the @error line with code below to find out what the error is.

Code:
 
cerror @error " " @serror

Function Cerror()
exit Iif(@error<0,VAL("&"+Right(DecToHex(@error),4)),@error)
Endfunction