top | item 37225753

(no title)

vba | 2 years ago

This was a nice surprise to see today as an Ex-Excel developer who worked on trying to bring Python to Excel (and, I guess, failing ;)).

7+ years ago I had the option of leaving the Excel team. My then boss’s boss knew I had an interest in bringing Python to Excel and offered me a chance to tackle it if I chose to stay. What was meant to be a 6 month project turned into a ~3 year project, the Python part faded away and we ended up enabling JavaScript Custom Functions in Excel instead.

For Python we were also running ‘in the cloud’ (AzureML v1), although there was some back-and-forth on if we should run locally. I think what made the Python part disappear was our partner AzureML team re-orged, re-released, re-hired, we lost a PM and our work caught the attention of another partner team who realised they could use our code to execute their JavaScript out-of-process. And so I spent a lot of time ensuring that feature was successfully shipped at, I guess, the detriment of Python.

I had a lot of help from some strong engineers and learnt a lot. The core of the work was modifying the calculation engine of Excel to allow functions to compute asynchronously, allowing the user to continue working on other parts of their spreadsheet while the remote endpoint (be it JavaScript, Python or something else) was computing. Previously the spreadsheet would lock up while calculations were running, and that wouldn’t be cool for long-running unbounded calculations. Have to wonder if any of the stuff we built made it into this new feature.

Super great to see this and look forward to trying it out.

Recalc or die

discuss

order

fzumstein|2 years ago

Thanks for your work! The async JS functions are amazing and allowed me to ship rock-solid Custom functions with xlwings and Python. The problem with Office.js is that it’s just simply too hard to get started with all the npm bloat for the average Excel user (even more professional devs struggle). Well, I am pretty happy how I am saving users from having to use Node.js: https://docs.xlwings.org/en/latest/pro/server/officejs_custo...

vba|2 years ago

Oh this must be Felix! I saw and played with xlwings many years ago and was impressed :)

Agreed with the friction around getting started. I would like to see it reduced. It’s cool to see you using them to wrap Python functions - I have done something similar before myself, and still need to get around to shimming Haskell into excel at some point.

Another thing I don’t like is how JavaScript Custom Function cell formulas have a horrible string after the _xldudf marker, which becomes noticeable if your workbook doesn’t/can’t load the custom functions addin (or you unload the addin)

Thanks for your comment

ripley12|2 years ago

> The problem with Office.js is that it’s just simply too hard to get started with all the npm bloat for the average Excel user (even more professional devs struggle)

IMO deployment is an even harder problem. The Office team makes it incredibly difficult to deploy web add-ins (presumably for business reasons) and accordingly most companies I'm familiar with are still using the ancient, barely-supported COM+VSTO add-in models.

bubblebobble|2 years ago

This is so weird. I built a working "python within excel" a few years back. (it also did sql and matlab&r remotely)

Abandoned now: https://alphawolfxl.com/

I abandoned this when some people I asked to beta test it said "their company wouldn't pay for it" and gave me the impression I'd wasted my time....

....Not sure how to feel about this.....

kosolam|2 years ago

Don’t feel too bad because if you would have created a product from it, today this product would be deprecated..

jll29|2 years ago

You were just ahead of your time!

rvba|2 years ago

Do you know why Microsoft never made proper examples of the new technology? The few examples provided are for programmers only.

In general there is a scarcity of working code that you can inspect to see how javascript in Excel works.

Now it is mostly "how to draw an owl"

vba|2 years ago

I don’t unfortunately. Given the more technical nature of the feature I’m inclined to agree Microsoft should make a bountiful supply of working examples.

fzumstein|2 years ago

Glad I am not the only one with this impression :)

dnadler|2 years ago

Thanks for your work on that! I use custom JavaScript functions to hit our internal analytics API. It was really nice to work with.

vba|2 years ago

Thanks for your kind words. Did you ever use streaming function to update your analytics periodically or when new data become available?

jakzurr|2 years ago

That's really an interesting story; thanks for sharing it.

smitty1e|2 years ago

Great user name.

I have a private github repo called NVBC, the "NecroVisualBasiCon", with all of my favorite VBA-isms.

When I code it, I indent all of the `End *` lines to column 80, to make the VBA look more like python.

paulddraper|2 years ago

Appropriate username

vba|2 years ago

An aside - I wanted the username xl but someone registered it the day before (the day before!) me on hn.

doctorpangloss|2 years ago

> the Python part faded away and we ended up enabling JavaScript Custom Functions in Excel instead.

Nobody could have anticipated that GPT4 would author Python better than anything else.

Nonetheless, I kind of just want Google Drive except Excel, without adopting anything more than the Office ecosystem, that just works with simultaneous editing.