Strange particles and hyperfragments in collisions of antiprotons and protons on nuclei have been investigated systematically within a microscopic transport model. The hyperons are produced from the annihilation in antibaryon-baryon collisions and strangeness exchange process in antiproton induced reactions. A coalescence approach is used for constructing the primary hyperfragments in phase space and the statistical model is modified for describing the decay of hyperfragments via evaporating hyperon, neutron, charged particles etc, in which the shell effect, binding energy and root-mean-square radii are taken into account. It is found that the influence of the hyperon-nucleon interaction on the free $Lambda$ and $Xi^{-}$ production is negligible. However, the large hyperfragment yields are obvious with the attractive potential. The production of double strangeness hyperfragments are reduced below 1$mu b$ in comparison to the yields of $Lambda$-hyperfragments with the cross sections of 0.05-0.1 mb in the antiproton induced reactions on $^{63}$Cu at the incident momenta of 1-5 GeV/c. The light hyperfragments are formed in the dynamical fragmentation process. The energy dependence of hyperfragment formation is weak once the incident energy above the threshold energy for the hyperon production.