News for hackers. Stuff that matters.
Re:Windows is doomed by roenxi on Friday September 01, 2017 @10:38AM (#15148650)
Just for fun; I recorded a macro in LibreOffice Basic that sets the text in a cell.

This is a sample:

  dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

  dim args1(0) as new com.sun.star.beans.PropertyValue
  args1(0).Name = "ToPoint"
  args1(0).Value = "$C$7"

  dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
That first line is confusing and obsolete. Sun doesn't exist any more, it is two generations of branding from being StarOffice, and good luck figuring out why the service is named after a card game. Even a programmer isn't going to figure all that out without knowing the history of the project.

Now in MS Office I'm pretty sure this would be something like ActiveSheet.Cells(1, 5) = "foo". There is nearly no discovery for the LO Basic equivalent 'sheet.getCellByPosition(3,16) = "foo"'.

It really is worlds apart. I don't see how a moderately sophisticated user can learn to write LO macros without finding a reference manual and investing hours orienting themselves. I've seen people teach themselves to a useful standard using MS Office macro recordings.

EDIT More importantly, a novice wouldn't necessarily understand that the recorded macro isn't the accepted way to select a cell. Even realising that a cell can be selected with one line is hindered by the LO macro recording.

Re:Windows is doomed by michrassena on Friday September 01, 2017 @01:51PM (#15150792)
That's a ridiculous level of verbosity for what should be the most basic of tasks. Not to mention is has its roots in Java. I would have figured that LibreOffice, which is touted as an MS Office replacement would have full compatibility with Macros written in VB.
Re:Windows is doomed by m-p-3 on Friday September 01, 2017 @10:48AM (#15148756)
They really need to make an easier and modern way of scripting in LO.
Re:Windows is doomed by nunez on Friday September 01, 2017 @10:56AM (#15148816)
Wow; that is horribly unreadable. :-(
Re:Windows is doomed by endorphone on Friday September 01, 2017 @10:53AM (#15148793)
Macro-programming Office documents is one of those things that should immediately elicit the question "Is there a better solution?" There almost always is. Office documents are an extremely poor workflow and a terrible artifact for data.

Which is why replacements seldom have more than the most trivial of automation -- the people who are making the move usually change their workflows. The offices that built around Office 95 are, however, still doing things the way they always do.

EDIT: What a changed world when this is a contentious comment.

Re:Windows is doomed by zdragnar on Friday September 01, 2017 @12:47PM (#15150157)
The thing is, it can be done by a "non programmer" without IT or admin overhead. Building or buying a new solution outside of Office requires far more buy-in and cost.

It may not be the best workflow, but it is the most accessible one for an individual to start with.

Edit: for what it's worth, I agree that it can be a hindrance to a company when it becomes a core operating process. However, that doesn't mean that it is inherently wrong for many needs

Re:Windows is doomed by endorphone on Friday September 01, 2017 @01:52PM (#15150795)
Sure, I get where it comes into play. A team usually has the "techie" guy who decides to roll some macros, and soon it becomes embedded. In the last decade and before this was the engine of an enormous amount of end user computing.

But in 2017, it is almost always a very bad sign. Which is why the competition have mostly abandoned automation of the 1990s Office sort.

Re:Windows is doomed by sclangdon on Friday September 01, 2017 @10:59AM (#15148859)
What is a "better" solution? If a macro-programmed office document is doing its job, what constitutes "better"?
Re:Windows is doomed by endorphone on Friday September 01, 2017 @11:09AM (#15148999)
Why scarequote better twice? It is possible, you understand, for some solutions to be better than others.

In 2017 there are shockingly few cases where macro programming an Office document is an ideal solution, and it is usually a really clear sign that you're approaching the problem wrong. It was seldom a good solution even in 2010.

It's funny that in these conversations people always bring up finance. I work in finance, for a wide variety of companies making a wide variety of solutions. Excel automation is a curse. Every Excel automation is an abomination from a decade plus earlier -- islands of data, extraordinarily full of errors, security nightmares, data exposure risks, and on and on.

Re:Windows is doomed by cmiles74 on Friday September 01, 2017 @01:14PM (#15150413)
This. I don't think those automated Excel spreadsheets are doing as great a job as people think. Every time I've been brought in to try and migrate people away from these kind of solutions, we've exposed many bugs. Some not a big deal, others costing the company real money.