Yes and no! Before being actually living in Spain it's not possible to enroll in a public school, therefore it's not possible to obtain the admission letter that students need for the visa application. This problem doesn't exist with private schools, that's why it's the best option when you're abroad.