[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Assign Excel cell value from Datepicker widget Selection using Python

On 29/06/20 3:04 AM, narenchunduri at wrote:
> When I run the python code I should be able to open my Excel and when I click on one Excel cell I should have my datepicker widget popped up and I should be able to select any date from my datepicker widget as my Excel cell value
> Tried below code but in vain: (Used jupyter Notebook)
> from ipywidgets import widgets
> from openpyxl import *
> wb = load_workbook('My_Excel.xlsx')
> worksheet =
> worksheet['B1'] = 'Datepicker'
> worksheet['B2'] = widgets.DatePicker()
> wb.close()
> Error Occured: ValueError: Cannot convert DatePicker(value=None) to Excel

Do you know what comes back from the DatePicker() and is it suitable for 
this purpose?

Recommend capturing it to a variable, and then printing its value (and 
type(), if necessary) to be sure of the facts...

Let us know how you get on...
Regards =dn