Please help me with Python Excel work.

Asked 1 years ago, Updated 1 years ago, 287 views

def findfile(name, path):

for dirpath, dirname, filename in os.walk(path):
    if name in filename:
        return os.path.join(dirpath, name)

filepath = findfile("excel.xlsx", "/")

wb = load_workbook(filename=filepath, data_only=True)

ws = wb.get_sheet_by_name('excel')

df = pd.DataFrame(ws.values)

I'm working on Excel by making a code like this.

But when I save it in Excel in Python,

All functions already specified in Excel are changed to absolute values and stored.

Is there any way to save the Excel functions while maintaining them?

excel

2022-10-24 00:00

1 Answers

Since you set data_only to True, the functions are all entered as values. Since the default is data_only = False, it will be solved by just erasing that part.


2022-10-24 00:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.