python gspread set hyperlink gives parsing error

18 views Asked by At

I'm using python, i am a newbie. When i want to set a hyperlink in a sheet, using gspread, the program works fine. But when i look at the result in the google sheet, it gives me 'parsing error' in the field where i had put my hyperlink. My code looks like this:

cell_row = 3
cell_column = 9

# URL to link to
url = 'https://www.google.com'

# Text to display for the hyperlink
link_text = 'Click'

# Create the hyperlink formula
hyperlink_formula = '=HYPERLINK("{0}", "{1}")'.format(url, link_text)

# Update the cell with the hyperlink formula
sheet.update_cell(cell_row, cell_column, hyperlink_formula)

i've searched everywhere, tried various options, been stuck for about 6 hours now. I just don't know why the code works fine but the result in the sheet goes wrong. If someone can help, please answer with enough explanation what to do to solve it, because i'm new in python. Thanks in advance !!!

0

There are 0 answers