Harry and Meghan, aka the Duke and Duchess of Sussex, arrived at the state-of-the-art tech park on the Bognor Regis Campus of Chichester University.
Cheers and applause came from staff, students and members of the public as the royal couple arrived at the tech park at about 11.40am
William Dickson, 19, said: "Having the royals come is something I didn't anticipate. I never thought they would come but what a fantastic way to open the place.
"Probably the biggest couple in the world right now coming to the uni makes it feel pretty special."
Students in their halls of residence shouted: "We love you Harry," as the couple began to enter the building before adding: "But we love you more Meghan."
Dr Andy Clegg, 49, tourism management lecturer and the university said: "I have worked here 22 years and this is definitely the most high profile event we have had - I think it's brilliant."
The Duke and Duchess of Sussex spoke to reservists in the armed forced who were made up of staff and students before going to speak to a group including the mayor of Bognor Town Council and the Bishop of Chichester.