Someone making a romantic advance toward you at work is not necessarily harassment the first time it happens. If a co-worker asks you out and your company does not have a policy against employees dating, they haven’t done anything wrong.
When it turns into harassment is when it keeps happening. Say that they ask you out, you turn them down and they make it a point to come to your desk every single day as soon as they arrive at work. They “compliment” you and make comments about how attractive you are, then ask you out again. You can imagine how infuriating this gets when the comments don’t stop, and they’re definitely harassing you, perhaps to pester you into going out with them or just to annoy you since you turned them down.
For this reason, it is important to be open and honest with the person the very first time they approach you. Don’t leave any room for interpretation. Don’t feel like you have to humor them or go along with their advances. Directly tell them you do not want to have a relationship with them. If they continue to pursue you, tell them that their actions make you uncomfortable and that you would like them to stop.
This way, if they do not stop and you decide to go to HR and complain, you can easily show that they were intentionally harassing you. They can’t claim that they thought you wanted the attention because you made it clear that you did not. It may even be time to look into all of your legal options.