Hello!
May I get some help with a bit of Python code? Essentially, I would like to be able to provide a list that includes a file path, an old sheet name, and the name I would like that old sheet name to be changed to. These are for excel workbooks with multiple sheets and the contents of the sheets need to remain unchanged after the tabs are renamed. I've attached a sample scenario/WF below for clarity.
Thank you for your help!
Solved! Go to Solution.
Hello
I am getting the following error:
NameError Traceback (most recent call last) Cell In[3], line 2 1 for i, (file, old_sheet, filename, new_sheet) in df.iterrows(): ----> 2 wb = XL.load_workbook(file) 3 try: 4 ss = wb[old_sheet] NameError: name 'XL' is not defined - any idea why that is?
@Kingazawora --- python is case sensitive. The original code imported the excel python package as xl.... if you are doing that --- you can use xl.load_workbook.