The art of perfect pasta was just one of the activities the Duke of Kent took an interest in when he visited Bingley Grammar School yesterday.

The Duke, pictured chatting to pupil Chris Dunn watched by chairman of governors Jim Britton, was invited to the school to officially open its £4.5 million building project including a new library, hall and technology block.

He arrived at the school early and spent more than an hour touring classrooms and talking to staff and pupils.

Head teacher John Patterson said: "It makes it a real sense of occasion for a member of the Royal Family to be here. The pupils are justifiably proud of the school."

The Duke spoke to GCSE and A-level pupils studying subjects in design and technology and wished them success with their exams.

As he and his party walked around the school pupils were on hand at every door to open them to let him through.

The Duke asked some pupils what lessons they were missing to be on door duty and when they replied 'science' he asked if that was why they were all smiling.

In the impressive new library the Duke was introduced to 18-year-old Becky Carlyle who has been offered a place at Oxford University to study medicine.

She said she was excited to meet the Duke as she hadn't met a member of the Royal Family before. She said: "He spoke to me about my offer from Oxford and also about my hobby - orienteering. I am in the national team so he was asking me where I had been."

The Duke was asked to unveil a plaque in the new school hall and entered to a brass fanfare. He was then treated to some Glenn Miller music played by the school's swing band.

Pupils, staff and guests crammed into the hall for the unveiling.

Before performing the official ceremony and opening the Airedale Buildings the Duke said: "I would like to say how much I've enjoyed coming to your marvellous school today. It's very clear to any visitor walking round how enthusiastic and how keen all of the students are in this school on the subjects you are studying.

"Some were producing amazing pasta and it's clear how much they seemed to enjoy the work they do.

"This is reflected in the success the school is having and continues to have which you are all contributing to."

After the unveiling he waved and thanked the band as he left the school for his next stop at the National Museum of Photography, Film and Television in Bradford, of which he is a trustee.

After lunch at the museum the Duke, together with 30 pupils from Bingley Grammar School, was treated to a preview performance of a 3D IMAX film - Cyberworld. The film will be on show to the public at the museum from Thursday.

The Duke was also given a tour of the museum which is hosting the Star Wars exhibition.