  The effect of substituting iron and zinc for cobalt in CaBaCo$_4$O$_7$ has
been investigated using neutron diffraction and x-ray absorption spectroscopy.
The orthorhombic distortion present in the parent compound CaBaCo$_4$O$_7$
decreases with increasing the content of either Fe or Zn. The samples
CaBaCo$_3$ZnO$_7$ and CaBaCo$_{4-x}$Fe$_x$O$_7$ with $x \leq 1.5$ are
metrically hexagonal but much better refinements in the neutron diffraction
patterns are obtained using an orthorhombic unit cell. The two types of
substitution have opposite effects on the structural and magnetic properties.
Fe atoms preferentially occupy the sites at the triangular layer. Thus, the
replacement of Co by Fe supresses the ferrimagnetic ordering and
CaBaCo$_{4-x}$Fe$_x$O$_7$ samples are antiferromagnetically ordered with a new
propagation vector k=(1/3,0,0). However, the Zn atoms prefer occupying the
Kagome layer, which is very detrimental for the long range magnetic
interactions giving rise to a magnetic glass. The oxidation state of iron and
zinc is found to be 3+ and 2+, respectively, independently of the content.
Therefore, the average Co oxidation state changes accordingly with the
Fe$^{3+}$ or Zn$^{2+}$ doping. Also, x-ray absorption spectroscopy data
confirms the different preferential occupation for both Fe and Zn cations. The
combined information obtained by neutron diffraction and x-ray absorption
spectroscopy indicates that cobalt atoms can be either in a fluctuating
Co$^{2+}$/Co$^{3+}$ valence state or, alternatively, Co$^{2+}$ and Co$^{3+}$
ions being randomly distributed in the lattice. These results explain the
occurrence of local disorder in the CoO$_4$ tetrahedra obtained by EXAFS. An
anomaly in the lattice parameters and an increase in the local disorder is
observed only at the ferrimagnetic transition for CaBaCo$_4$O$_7$ revealing the
occurrence of local magneto-elastic coupling.
