There are quite a few circumstances in which the Export operation can omit to use the export filename specified in the current Export config file (by $filename()).
These are when the user opens the File | Export dialog and then before clicking OK does one of the following:
a) clicks New and enters $filename() in the config file
b) clicks Edit (or use a preexisting editor window on the current config file) and changes $filename()
c) clicks on the current config
The dialog doesn't update its "Export file name" control accordingly, so the specified filename is not used.
A workaround is to then click on another config (if one exists) and then click on the current config.
A good fix would be for the "Export file name" control to update upon (or in the case of external events, upon return to the dialog after) any of these events.
Likewise with the Tools | Options | Export dialog. Its own "Export file name" control is not updated upon the actions listed above.