I think I may have a rather unique issue and have not yet found a viable solution. I am using this macro to scan a folder for xlsx files, create a list of files in the folder (all of identical format), and then import them. I am interested in importing 6 sheets from each file so I have adjusted the code accordingly. The reason I mention this is because I will be importing thousands of files, each exported manually from on online database and saved to said folder. The issue I am running into using a simple proc import step with sheet statements (tested outside of macro) is "ERROR: Couldn't find sheet in spreadsheet." When commenting out the sheet statement and trying to just import the file (defaulting to importing the first sheet) I get "No worksheets in the .XLSX file Requested Input File Is Invalid ERROR: Import unsuccessful. See SAS Log for details." After diligently checking sheet names, file names, etc., I have discovered that the issue lies in one of two problem: 1) these files are not being opened and saved prior to attempting to import them into SAS which may or may not tie into 2) the files are in protected view and have not been opened and saved to enable editing. Does anyone have any ideas how I could get around this without opening and saving every single file? Again, there are thousands.
... View more