Calc - Basic script for Saving a named-range to csv

Within Calc, what is the Basic script to save a named-range within a spreadsheet to a csv file ?

e.g. named range within the Calc spreadsheet contains a table of numbers, just want to save this range to a csv-file.

Many thanks in advance!

A very similar problem was discussed and solved here

To the best of my knowledge, there is no save option. What I would do is to copy the range into a new sheet and save it as a CSV file.

OK, no save named-range option. Looks like your option is the only way.