The Danish monarchy is over 1000 years old, but the English and Japanese monarchies are older. These rulers have had the sense to move with the times, which has mostly meant assuming a symbolic role and delegating actual power to elected officials. Their resilience has been remarkable. Nevertheless monarchies will eventually die out, as people will resent the amount of taxpayers' money that keeps them in luxury.
If royal families don't actually rule the country, they shouldn't exist. They're just a distraction from more important things, like how the country is actually governed. I would be very angry if my country had a royal family, especially if it was funded by taxpayer money. If you don't provide any value to the country, you shouldn't get taxpayer money.
Yes, monarchies are destined to die out because the world is changing quickly. There is no way a family will be able to continue its line for thousands of years because something could happen to the descendants. Maybe someone will not be able to have children, which will end the family line.
The Danish royal family, in a similar way to the institution of the monarchy in Spain and the United Kingdom, are fairly popular in their country of origin. While the monarchy as an absolute vestige of power is never likely to return to Europe, the token royal family as a reminder of the heritage of the nation is something many populations would be loathe to be rid of.