Which figure of speech describes phrases like Buckingham Palace has announced it will issue a statement tomorrow in which something, ie the Queen is replaced by something closely associated with it, ie Buckingham Palace.
Metonymy, yes, but I think it could also be personification. In this example, an inanimate object (palace), performs a task normally reserved for humans (announcement).
In a very general sense I guess it could be called personification - but the unique relationship between the Palace and the Queen it represents makes it metonymy.