Well, the first thing, now dry: Mecca cannot be visited . Now the explanation. Very few countries in the world are closed to tourism, but Saudi Arabia is one of them. You cannot get a tourist visa to visit the country, although there are several ways you can get a special one called a visit visa . In the first place, the only foreigners who can enter the country are those who, being Muslims, are going to make the pilgrimage to Mecca or any other person who for work or commercial reasons must visit one of the cities.
In the case of Western tourists who are not Muslims, you can apply for this visit visa as long as you have a person who answers for you in the country, who must be of Saudi nationality or expatriate and take care of all the necessary procedures in the own country. If they give you permission for your visit, you should go to the Saudi Arabian embassy in Spain (or wherever you read us from) to get your visa issued. Your passport must have an expiration date greater than six months after the expected date of entry into the country.
As for Mecca in particular, both that city and Medina are forbidden to people who are not of the Muslim religion , so if you wish to visit it, do not bother to start the procedures unless you are Muslim. Another fact that you must take into account, especially if you are a woman, is that if you visit Saudi Arabia, even if it is any other part of which we have spoken, you must be accompanied at all times by your "friend or guarantor" since it is not allowed that women go nowhere alone.