Aug-24-2018, 05:09 AM

str = ''.join(match) for root, dirs, files in os.walk(os.path.abspath(str)): for file in reversed(files): jobno_files_found = os.path.join(root, file) print("files found: ", jobno_files_found) wb2 = openpyxl.load_workbook(jobno_files_found) print("wb2.sheetnames: ", wb2.sheetnames) for jobno_found in wb2.sheetnames: print("jobno_found: ", jobno_found) temp_sheet = template[jobno_found] #Add Sheet name createData(sheet,temp_sheet,template,jobno_files_found,original_source_wb_row_no)The code runs showing all sheets per file when last 2 lines are removed, but when lines are included sheet not found error is coming from code below, which doesn't makes sense since sheets are seen above.
temp_sheet = template[jobno_found] #Add Sheet nameAny help or advice is greatly appreciated, thanks.