There is not really a set standard of how you want to deal with greating someone. Instead consider how you appear to them.
When you standup and great someone you make it clear to them that you are focused on them and their issue. If you stay seated they do not know for sure, and if you continue working while talking with them it gives the appearance that either you do not care about their issue or you are too busy to give it proper attention. So even if you stay seated stop working on your task so that they know you are giving their issue proper attention. At the same time if someone is constantly interrupting with inane and off topic chatter staying seated and working is one subtle way of indicating you do not appreciate their interruptions.
If you stand up to address people when they come over you also demonstrate to them that you are willing to be slightly put out for their needs. A considerate person will consider this before interrupting your work for trivial or lesser needs. In the end it might save you some interruptions.
For superiors, especially executives, the proper professionalism is to stand to greet them and remain standing and focused on them until they leave. If they come with instructions for your work, then it is fine to pick up a pen and paper to write it down but not proper to sit and type it in while they wait. If they ask for some data that is simple to retrieve while they wait you can offer to get that for them right now, but if they say just email it to me then accept their preference and retrieve and email the information after they leave not before.
Some people will say this is not really necessary in many of the new and more informally run companies. But unless directed specifically not to, I have found that acting professionally like this is appreciated, sometimes especially in more relaxed environments. Keep in mind "You don't have to stand for me." is very different from "Please don't stand every time I come over", or "We are a more casual company and it would probably be better if you didn't take a formal posture all the time." The first is just an acknowledgement that you are going above and beyond expectations. The later two are requests to discontinue the activity. Unless directed not to I prefer to err to the side of professionalism.