Invalid outside of Type block
The element As type clause is permitted only within a Type...End Type block.