Python Forum
python openpyxl writing data - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: python openpyxl writing data (/thread-21815.html)



python openpyxl writing data - Bikram - Oct-15-2019

Hi,

I can write numerical data to the excel file. But it saves as a text. I am using "openpyxl" module for creating, writing and saving excel file.
Can anyone help me to convert the data to numerical data in excel file.

Any help is appreciated.

Thanks,
Bikram


RE: python openpyxl writing data - Larz60+ - Oct-16-2019

you forgot to post your code


RE: python openpyxl writing data - Bikram - Oct-17-2019

Sorry !!
I solved this problem.
I have anew problem. I ma not able to delete a Bar Chart which i have created using OPENPYXL in PYTHON.
Here is the code:
chart=BarChart() 
data=Reference(sheet2,min_row=2, max_row=sheet2.max_row, min_col=3)
category=Reference(sheet2,min_col=2, min_row=2, max_row=sheet2.max_row)
chart.add_data(data, titles_from_data=False)
chart.set_categories(category)
sheet2.add_chart(chart,"M3")
chart.title="Count"
chart.x_axis.title= "Time"
chart.y_axis.title="Reason"