I don't use MS Office, but does Excel seriously not simply show a dialog, where the user can select this and maybe even auto-detects it? That's what I'm used to from the "subpar clone" (/s) from the Document Foundation.
It mostly did that until they changed it few versions ago, now it sometimes does, sometimes does not and sometimes falls flat on face depending on exact context of your action…