Look at an object

I need that the object A looks at the object B, so I used the LookAt method. The problem is that when B moves in the y,z plane (relative to A) the object A starts to rotate also on his Z axis, messing all the calculations connected to it. How can I make A rotate only around the y and the x axes?

Take a look at Locking LookAt.