Hello Carlos.Peres,
I finished and tested the macro code for retrieving data from the closed workbooks. This was a learning experience for me as well, which is why it has taken this long to complete. The biggest drawback with using closed workbooks is data in columns must be the same type (Text, Numbers, Dates, etc.). The ADO server samples the recordset (range) and uses the majority type. All other types are cleared. With 100 + workbooks, changing your data format isn't really an option at this point. The workbooks could be opened and closed automatically. The big drawback with this is you can't access the workbook's data if another user has it open.
There are three macros. The main macro prompts for the folder, and then loops through the folder looking for workbook files (xls extensions). The workbook data are retrieved from each sheet in the closed workbook, and posted to ActiveSheet of the open workbook. There is one macro to launch the Browse For Folders user interface using the API, and the other macro setups and manages the Closed Workboooks using ADO and SQL commands.
Due to length restrictions on posting I will make a second post with that includes the Browse For Folder macro.
Closed Workbook Macros
Sincerely,
Leith Ross
Bookmarks