I am trying to read Excel sheet buttons using Pandas and openpyxl.
Did all the stuff but I need to read “Option Buttons” like this Example of the buttons
I can read the selected option for DropDown Buttons, but for some reason Pandas don’t recognize the Option Button.
I think its because the button is not a cell with a value, I can change the Excel to make the button add a value equal to the option to a random cell, then read it, but I would like to know how to read these options buttons
No need for code here… If you want to replicate the context, create a xlsm file with a dropdown button and 1 or more Option Buttons, then read with Pandas or openpyxl.
import pandas as pd
df = pd.read_excel(rf"Your_File_With_Buttons.xlsm")
df
import openpyxl as op
file_path = "Your_File_With_Buttons.xlsm"
xlsm_sheet = op.load_workbook(file_path, read_only=False, keep_vba=True, keep_links=True, rich_text=True)
sheet0 = xlsm_sheet["sheet name]
print(sheet0["{your DropDown Button cell}"].value)
print(sheet0["{your Option button cell??}"].value)
StackOverflow recommended to me Questions like that:
python-html-button-click
But them doesn’t help me because they are about issues using Selenium or OS.
As you can see, you only can read the DropDown Button Value…
Just remembering: I just want to read the button that already exists and was selected.
Thanks for the patience and attention, you can correct my English too.
TinTin Esotérico is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.