How can i combine multiple spreadsheet files into one master spreadsheet? Is there a way to automate the process with some code?

I have multiple spreadsheet file in a folder. I want to combine them into a single master spreadsheet and i want to automate the process.

From the area bellow the grid where sheet tabs are displayed right-click and choose insert sheet - from file.
I can only assume that the equivalent is possible by scripting but I have no expertise in that. I’m pretty sure though the concept of master document only exists in the writer ODT / ODM documents.
(I assume the english equivalent terms from my localised version, so they may not be accurate in english)