Hi
I have multiple xlsb files in a folder which are protected by password. I would like to read only that sheet name is "Main"
Existing python code is reading only first sheet from each file
Attaching python code workflow for reference and sample xlsb file
For sample attached attaching xlsx file
Hi @BRRLL99
You could try changing the Python to this:
df_master = pd.DataFrame()
input_data = Alteryx.read("#1")
for i in range(len(input_data['FullPath'])):
full_name = input_data['FullPath'][i]
print(full_name)
pwd = input_data['excel_password'][i]
xl_app = w3c.gencache.EnsureDispatch('Excel.Application')
xl_wb = xl_app.Workbooks.Open(full_name, False, True, None, pwd)
sheet = xl_wb.Worksheets('Main') # Access only the 'Main' tab
content = sheet.UsedRange.Value
df = pd.DataFrame(list(content))
new_header = df.iloc[0]
df = df[1:]
df.columns = new_header
df_master = df_master.append(df, ignore_index=True)
xl_wb.Close(SaveChanges=0)
del xl_wb
xl_app.Quit()
Alteryx.write(df_master, 1)
@BRRLL99 updated macro attached
Hi @binuacs
I'm facing follow error, is there any reason for this ??
@BRRLL99 Can you post the full error message
@BRRLL99
Thank you for mentioning me but I dont really knwo about Python.
Hope @binuacs and @davidskaife solution fits what you need.
User | Count |
---|---|
109 | |
92 | |
78 | |
54 | |
40 |