Feedback by UserVoice

How can we improve Excel for Windows (Desktop Application)?

Python as an Excel scripting language

Let us do scripting with Python! Yay! Not only as an alternative to VBA, but also as an alternative to field functions (=SUM(A1:A2))

5,840 votes
Sign in
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Daniel shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    Accepting Votes  ·  AdminExcel Team [MSFT] (Admin, responded  · 


    Thank you to all those participated in our survey. What an amazing number of responses, many of them with very deep content. We’re processing the over ten thousand responses(!), and already appreciate the time so many of you took to answer with passion and experience.

    Please know this survey is used to help influence various topics – both on Python as well as other related topics that the comments started to bleed into. Given the passion, I want to be clear this remains an area of exploration for us, without any specific timeline.

    We’ll provide updates as we progress on this feature request.


    Ashvini Sharma
    Lead Program Manager


    Sign in
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      • Tom commented  ·   ·  Flag as inappropriate

        Being able to script Excel with Python would be great. It would be most useful if there were an API that could be used to run Excel using general-purpose Python scripts written in any environment. For example, I currently use xlwings to call Python user defined functions which, in turn, connect to other external tools, such as the DWSIM Standalone Thermodynamics Library. One further complication: that library is a .NET assembly, which means I also need pythonnet.
        Anything that streamlines the process of exporting third-party calculation results to Excel would be appreciated. My end users expect a pure, simple spreadsheet interface, yet need to access functionality contained in complex tools.

      • Jeff commented  ·   ·  Flag as inappropriate

        There are lots of python followers who might desire this!
        Personally the visual basic origins are sound and most desirable.
        Keep VBA at its root! Instead of including python directly, interface inward from Python to excel utilizing an API like you would with C/C++! If field function changes or alternates would be desireable I suggest you list them as suggested improvements individually and specify as to what you would change them to.

        Many people have their language of choice, this was already mine please don't mess with a good thing! Try instead this above suggested interface. There is only one vote button I assume that means agree, I disagree however!

      • Steve Barnes commented  ·   ·  Flag as inappropriate

        Actually why stop at python in Excel as an alternative to VBA, why not throughout the entire office suite?
        - Python in Word - I already have some very useful python scripts such as Glossary Check &/or Generate that I run externally but it would be great to run internally. Being able to run the NLTK within Word would open some fantastic options as would Pillow & matplotlib.
        - Python in Power Point - this would rock.
        - Python in Access would let you do something with your data - pandas anybody?
        - Python in Outlook - just as an example personalized Out of Office notifications, how long since I communicated with (in either direction) anybody from the purchasing department of a given company!

        I am reasonably sure that the majority of the Office components use common components for VBA so this should actually simplify implementation.

      • Sancarn commented  ·   ·  Flag as inappropriate

        The simplest way to implement this would be the following:

        Update ScriptControl for 64-bit (could simply use a daemon here)
        Add Python to ScriptControl.
        Allow addition of text files via VBE.

        Watch the magic happen!

        Dim o as new ScriptControl
        ScriptControl.language = "Python"
        ScriptControl.AddObject Application
        ScriptControl.AddCode MyPythonScript

      • Anonymous commented  ·   ·  Flag as inappropriate

        Are there any updates on this? We work heavily in VBA and would prefer this to remain or have plenty of notice of change.

      • Emanuele commented  ·   ·  Flag as inappropriate

        IF(SomeCondition, ValueIfTrue,"")

        I would like to leave the cell blank if a certain condition is not respected and the formula above is my best gues. However, my final goal is then to plot all the cells of a column where this formula is applied, but I end up with a lot of "zeros" plotted because the cell is not actually considered blank. Is there a way to go around this problem?

        Thank you

      • Stechyos commented  ·   ·  Flag as inappropriate

        @alpha6qcsDB you're right. However you forgot one thing: if MS provides just a good API, these tools can be used just by tech savvy people. If MS includes python in excel, sheets/workbooks could be crafted with python scripts and deploy the more people w/o provide support for installing excel add-ins and python virtual environments, so this will be more 'portable', efficient and less time-consuming.

      ← Previous 1 3 4 5 19 20

      Feedback and Knowledge Base