Hi ! It's always good to get to the bottom of a coding challenge but sometimes you just need an alternative solution. Depending on the version of SAS and or EG you are using you could try the LIBNAME engine XLSX. One line of code gets you all the worksheets (tabs) in a workbook. I created a dummy workbook with three tabs named 201701, 201702, 201703 with some regional salesperson data. With this simple libname, I have a SAS Lib (WRKBK) with all three tabs as datasets named 201701, 201702, 201703. (Keep in mind those names are not "good" dataset names because a sas dataset should not start with a numeric. I realize this doesn't solve the original macro question, but if you simply need to get the data into SAS to work with, this may be a quick alternative. SAS EG 8.1 code and lib libname wrkbk xlsx '\\denfilera\risk-mgmt\erm\personal folders\noble\libname_excel.xlsx';
run;
... View more