Live data from Hacker News

Another reason you should learn to code: Python for Excel

gigaom.com

11–20 of 32 posts

Re: Another reason you should learn to code: Python for Excel

#12

Two articles on HN, yet still no answer to "How is this better than using Python and Excel with COM?" I'm almost disappointed that so many people think this is an impressive new thing.

Maybe many people were unaware this was possible. My coworker was certainly excited.

Re: Another reason you should learn to code: Python for Excel

#14
I can see what the author is trying to get at, but I can't help but think the example is not so good.

If you use Excel and want to take it a bit further I would suggest that RExcel is probably a better choice. The R environment has abundant, relevant functionality for those who use Excel frequently.

When I encountered tasks that were tedious in Excel or beyond the abilities of Excel I went searching for a solution. After looking at VBA I eventually tried RExcel. I barely used RExcel as I found it more convenient to work in R itself. Now I use R and a database via ODBC far more than I use Excel. I can see using R as a gateway to other programming languages.

Re: Another reason you should learn to code: Python for Excel

#15
VBA is one of the best languages and environments for beginners ever. Why using Python instead would give the beginner anything, is beyond me.

Here's a shortlist:

- VBA is case-insensitive. If you don't know the significance of this, you've never taught beginners - VBA hides event binding and namespaces for the user. Major obstacles removed - VBA has full autocomplete - VBA has F1 context-sensitive help - VBA automatically formats and indents your code - VBA is more verbose, and verbosity aids comprehension - VBA finishes most of what you type, so you don't actually have to type much more than in Python - VBA was designed for Excel, and vice versa. The object models fit - There's tons of online resources for using VBA in Excel

And finally, VBA is dead-easy to learn, even for Microsoft-hating open source hackers. You just have to learn to get over yourself.

Re: Another reason you should learn to code: Python for Excel

#16
Also see PyXLL http://pyxll.com, which has been around for a while and is more comprehensive.

It lets you write Excel addins in Python in a very straightforward way. Python functions can implement functions, menu items, macros. Supports asynchronous functions in the latest Excel.

See examples here: http://pyxll.com/introduction.html

Re: Another reason you should learn to code: Python for Excel

#17

Two articles on HN, yet still no answer to "How is this better than using Python and Excel with COM?" I'm almost disappointed that so many people think this is an impressive new thing.

Hello Cell is far simpler with IronSpread.

No instantiating a COM object, no opening a workbook, no selecting a worksheet, etc.

Re: Another reason you should learn to code: Python for Excel

#18
post #15

VBA is one of the best languages and environments for beginners ever. Why using Python instead would give the beginner anything, is beyond me. Here's a shortlist: - VBA is case-insensitive. If you don't know the significance of this, you've never taught beginners - VBA hides event binding and namespaces for the user. Major obstacles removed - VBA has full autocomplete - VBA has F1 context-sensitive help - VBA automat…

With the same argument you would easily arrive to the conclusion that the best way to learn grammar is a spell checker.

Actually it depends, if those beginners are supposed to become programmers then you're wrong, if they just want to write one piece of software once in their life and never do it again then maybe you're right.

Post reply on HN