Hacker News new | past | comments | ask | show | jobs | submit login

VBA should be replaced by VB.NET or (Iron)Python.



Excel can be extended using .Net for quite a while now... this even allows you to add to the functions within excel. Writing Custom Excel Worksheet Functions in C# http://blogs.msdn.com/b/gabhan_berry/archive/2008/04/07/writ... How To Create an Excel Macro by Using Automation from Visual C# .NET http://support.microsoft.com/kb/303872/en-us How To Create an Excel Macro by Using Automation from Visual Basic .NET http://support.microsoft.com/kb/303871/EN-US


Given the basic programming ability of the folks using Excel, I would expect something more along the lines of BizTalk's orchestration designer or ChipWits.

and, yes I have spent the odd moment programming such a thing


Why would you prefer those to Python? (And to every other language?)


VBA is a surprisingly flexible language (although it does have many quirks) and is visually much cleaner than python.

Read the MS-VBAL spec: http://msdn.microsoft.com/en-us/library/dd361851.aspx


> and is visually much cleaner than python

I must respectfully disagree. Python is required to be visually clean by making indentation part of the syntax.


visual cleanliness is not just about whitespace. There are other considerations like how well the clauses stand out:

    If x > 0 Then
        y = 3
    Else
        y = 4
    End If
is much easier to scan than

    if x > 0:
        y = 3
    else:
        y = 4
Even though there are more characters in the vb side, the fact that the blocks are explicitly ended give you a much better mental cue than merely shifting the whitespace indentation


It's probably subjective. I've always found capitalisation makes scanning harder.

VB was one of my early languages, and I recall trying to find a way to turn off VB capitalisation way-back-when when I was developing in it.

But it might be odd to me. Whenever I see a directory of C with a CVS directory, I feel a brief tension from all the shouting.


I used to program in VB/VBA and switched to Python several years ago. As the other person who replied notes, 'visual cleanliness' is subjective, but I vastly prefer looking at Python to looking at VB/VBA, and I immediately began to prefer it on learning Python, despite having programmed in VB for several years previous.

Part of it is that you can communicate the same information with fewer tokens and in less space. My eyes don't have to jump around as much to figure out what's going on.


a .net based language probably already has hooks into the office API's, that would be one reason to use iron python vs. regular cpython.


The problem with ironpython is that it's not always compatible with all python libraries (esp. those based on C extensions; ie. heavy, scientific libraries similar to scipy); Using regular CPython immediately solves this problem. Also, the official .Net office API (read: VSTO) is not targeted on newbie programmers (imho).


and the problem with CPython is that is wouldn't be compatible with any of the office api's that are likely based on .net technology. so which one do you think would be better for office. I haven't done ms office automation since office 2k7 but that is the way it was heading.

edit: oh I see what you are getting at. a new product from a new company created at mit in 2012. https://www.datanitro.com/

I would argue that a $500 license is also not targeted at newbie programmers either.

can you run native python from excel without shelling out $500 ?


That's exactly what DataNitro offers - the entire Excel api in (C)Python.

Oh, and it's free for non-commercial use (educational etc.)


so datanitro really is the future of excel as described in the blog post. good to know.

I'm still curious as to how putting any "real" programming language behind spreadsheets is supposed to fix the situation that happened last week. the blog wasn't very convincing and it feels like it's just giving a poor disciplined group of people a more powerful tool to screw things up with. That's not a future I look forward to.


but none of the office api



Or F#, so you're already in a more functional environment.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: