Epitaxial films of YBa2Cu3O7 (YBCO) have been grown on single-crystal SrTiO3 and MgO substrates by two different routes using RF and DC magnetron cosputtering. In the first case, amorphous oxide films were deposited at a substrate temperature of 400°C and the crystalline film grew by solid-state epitaxy in an in situ postanneal at approximately 850°C. In the second case, a substrate temperature of 600-650°C was used which was sufficient to crystallize the film as it was deposited from the vapor phase. Reaction with the substrate was less for the films grown by vapor-phase epitaxy--even when they were annealed at 850°C--as shown by the transition temperatures of very thin films, Auger depth profile measurements, in situ XPS analysis, and transmission electron microscopy. XPS was used to show that segregation of Ba at the free surface can occur in either type of film. The relative merits of each growth process are discussed for microwave applications and tunnel junction fabrication.