Python Forum
Edit Open and Active Excel sheet in Python - 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: Edit Open and Active Excel sheet in Python (/thread-28668.html)



Edit Open and Active Excel sheet in Python - JoeDainton123 - Jul-28-2020

Hello community

This is Joe and i have decided to embark on learning how to code in Python after writing simple Macros in excel VB.

I am currently using anaconda/spyder.

My question is this:-
1)Can I open an excel spreadsheet via python
2) While the excel spreadsheet is open and active; change the data in the excel cells through python code such as print the numbers 1 through to 10 on different excel rows this is done as the excel spreadsheet is open?

I hope this makes sense.

Thank you for your input.


RE: Edit Open and Active Excel sheet in Python - Larz60+ - Jul-29-2020

Quote:Can I open an excel spreadsheet via python
yes, you can use a pagkage like openpyxl (popular, see: https://pypi.org/project/openpyxl/)
pandas is a better choice, but has a rather stiff learning curve (keep in mind, you will eventually want to switch).

will also work for your question 2