I have two reports that are exported from a database and saved into one folder as Excel .xls files. Contained within the two files are sheets that need (one sheet from each file) to be printed; one of the sheets is named “Total Statement” and the other sheet is named “Total Pieces Statement”. Due to the nature of the database, the names of the exported excel files come out as a random string of numbers and are unpredictable so I have been unable to use the standard print macros. In addition, the files come out in random order where the first file in the folder could be the “Total Statement” and the second could be the “Total Piece Statement” or vice versa.

I need a macro that will open each file and print out two copies of the either the “Total Statement” or “Total Piece Statement” depending on which sheet is contained within the file then close the files.

Can this be done?
Thank you for any and all help.