macro to save all .xls files in directory to .csv

Could you kindly help me with simple macro which would save all .xls files in given directory to .csv ?
All files have one sheet. Should be saved with ‘,’ delimiter. Default settings.

And all .xls files have one sheet only?

Do you know that a CSV file can only save one sheet? Do you understand that in any of your xls-books (or in all) there may be more than one sheet? You are not saying anything about what the macro should do in this case. You do not say anything about why you need it. You are silent about the format of the output files, about delimiters, about quotes, about the codepage …

A request for help could be “I wrote this macro, but it doesn’t work correctly - help me understand where I made a mistake.” Your “request” - do me a job for free.

Sorry. All those .xls files have only one sheet. ‘,’ is delimiter. Everything else is default.

On Linux:

for _file in $(ls -1 *.xls); do libreoffice6.4 --headless --convert-to csv ${_file} ; done

I don’t see the need for a macro (admitting this is a great simplification, with respect to filenames using white spaces)

On Windows for %i in (*.xls) Do "C:\Program Files\LibreOffice\program\soffice.exe" --convert-to csv "%i"
I don’t see the need for a macro too

Nice, I didn’t know it has console commands.

Fwiw, in the “Linux” (rather (POSIX) shell) version the ls subshell command is not only superfluous but may have the undesired effect that all content of any directory ending in .xls would also be listed. Also, if there are file names with spaces then the ls subshell command will let the for loop see them as individual entries split at spaces, which does not happen with the shell’s file name expansion. File names with spaces then can be handled by quoting the variable. So:

for file in *.xls ; do libreoffice --headless --convert-to csv "$file" ; done

(this does not exclude potential *.xls directories but at least doesn’t include all their content).

More help on command line options with libreoffice --help. Also convenient for file conversion, specifically mass conversion, is the unoconv command of a separate package.