1

I want to write python code to automate some excel procedures which I do on a daily basis and take me alot of time.

is there any package (or add-in in excel) I can use to run python code in excel?

Thanks!

1
  • would using libre/openoffice be an option? it uses python as its scripting language. Commented Jan 2, 2018 at 16:43

3 Answers 3

3

xlwings will let you "Replace VBA macros with clean and powerful Python code."

See - https://docs.xlwings.org/en/stable/

Sign up to request clarification or add additional context in comments.

2 Comments

Seems this is no more available
Thanks for pointing that out. I have updated the link.
0

A google search of 'python excel' turns up this:

https://www.pyxll.com/

There are also some modules that allow you to manipulate excel files with python scripts, such as http://xlsxwriter.readthedocs.io/, which may be an attractive alternative.

Comments

0

Hard to answer without more info on exactly what you wish to do, but the OpenPyXL module for Python might be a good place to start.

As for running python directly in excel, I believe XLWings would be an option for you but, myself, I would rather just write a python script outside of Excel that takes the excel file as input and does whatever operations are needed using OpenPyXL (or some other module).

1 Comment

Hi, I basically want to do several simple actions in excel like sort data by date and time, generate pivot table etc...I know i can do these commands with VBA but i dont know this lang and its looks pretty complicated to learn so i prefer try the python option...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.