Hello ndsutherland,

If the workbooks you are opening are xlsx then the code will fail. The reason is an xlsx workbook does not contain VBA macros and therefore no code modules.