Python Forum

Full Version: Edit Open and Active Excel sheet in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Quote:Can I open an excel spreadsheet via python
yes, you can use a pagkage like openpyxl (popular, see:
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