News for hackers. Stuff that matters.
Re:Advancing Excel as a programming language [audio] by ww520 on Wednesday May 05, 2021 @12:10PM (#27051763)
Scripting with Excel can be done in two ways: one is Excel as a host calling the scripts inside Excel, and the other is controlling Excel in another hosting language. The first can be done with VBA or Excel Javascript. The second can be done via the COM Automation interface supported by Excel. Any language that can talk to a COM Automation server can start Excel as an embedded COM object and call Excel's COM Automation API to control it. Visual Basic, JScript (Windows' Javascript), C++, C#, Java, Mathlab, Python, and others can talk to the COM Automation servers, and can script against Excel.
Re:Advancing Excel as a programming language [audio] by aarondia on Wednesday May 05, 2021 @12:15PM (#27051860)
One example is https://www.pyxll.com/ which lets you write Excel Add-ins using Python.

I've never used it myself, but I have tried to use the Excel JS API, and it was quite a pain.

Re:Advancing Excel as a programming language [audio] by ww520 on Wednesday May 05, 2021 @12:23PM (#27051954)
Yes. I believe the way Excel hosting other languages inside it as scripting addon is via the COM Automation Server interface again. The other language needs to implement as a COM Automaton Server. Excel then instantiates the other language's Automation Server as an embedded COM object and calls its interface, which can call the functions implemented with the language.
Re:Advancing Excel as a programming language [audio] by tinomaxgalvin on Thursday May 06, 2021 @03:39AM (#27060205)
The approach used by pyxll is higher performance. It uses the Excel C API. Excel add-ons can be written as native DLLs known as XLLs.
Re:Advancing Excel as a programming language [audio] by ww520 on Thursday May 06, 2021 @02:39PM (#27067453)
Good to know.