Manipulating payloads with gantry cranes is challenging due to possible undesirable load pendulations induced by the crane motion and external perturbations. When the work environment is cluttered with obstacles, the problem gets increasingly difficult, which must be avoided, resulting in the need for appropriate load trajectory planning and more cautious craning strategy. The trajectory is first sketched by a series of points in the work space, and then approximated by spline functions. A rest-to-rest load motion along the specified trajectory is then imposed, resulting in one coordinated manoeuvre that omits the obstacles. The control of crane executing the load motion is viewed as an inverse dynamics problem, strongly influenced by the underactuated nature of the system. The arising governing differential-algebraic equations enable one for the analysis of crane dynamics and synthesis of its control in the specified motion. The open-loop control obtained this way is enhanced by a closed-loop control with feedback of the actual errors in load position to provide stable tracking of the reference trajectory in presence of perturbations and modelling inconsistencies. Some results of numerical simulations are reported.