You misunderstand the use of Macro. It in itself does nothing, it only creates string data output - a bit like Find/Replace.
If this "data source is settled as XLSX" is true, then you are going to have no end of problems with it. Not going over it, you will find out over time.
Simplest way of solving your problem, have a fixed tab at the front of the file, which contains on list of each of the tabs in the workbook, you can read that and then process the other tabs.
... View more