OpenOffice VBA

I’ve just downloaded OxygenOffice 2.2.0, based on OO2.2. This version has VBA support.

The recommended way to check if your version has VBA support is to open an .xls with code in and look at it in the basic editor. If it is all rem’d out (remember ‘rem’? (for comments (remarks))) then you don’t have support. If it isn’t you probably do. Its a long way from complete at this stage, and realistically isn’t going to run anything too complex just yet. But its a start, and its interesting to see an organisation recognising the importance of VBA.

I don’t think there is much support for writing VBA, it looks like the initial aim is to run existing VBA. You can write some VBA:

sub VBAMain
ActiveCell.Value = "Hello VBA style"
end sub

Or you can record it in Basic:

sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")
rem ----------------------------------------------------------------------
dim args1(0) as new
args1(0).Name = "StringName"
args1(0).Value = "Hello"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1())
end sub

I think there is some way to go for sure, but its pretty neat to see what we know as VBA running fine in OpenOffice. Comparing the 2 examples above, I think VBA is going to be more approachable than Star Basic.

I’m not a total VBA fan boy, there are other technologies I would rather use for many things. But I have a lot of respect for the designers of VB6/VBA, I really think they hit the sweet spot between too simple to do anything useful, and too rigid/complex to be beyond the use of business/non IT people. I’m not convinced MS are really targetting this user group with their current offerings, and I think they should be.

Another thing is that all this is open source so even if the VBA IDE continues to stagnate, there may be the chance to use the OO Basic IDE to write VBA for Excel.

I’m also wondering about Python, that seems to be getting a lot of attention as a ‘user’ macro language. This is some way down my list of things to look at at the moment though.

One other thing I registered the other day is that VBA has been multithreaded (to some extent) since O2k I think (VB6). I have no plans to look into it in depth, but if you have a multithreaded app and you want to add VBA to it then thats possible. If VBA is thread aware I wonder why it hasn’t been revamped as part of the multithreaded calc? I guess its part of the MS philosophy – if its not managed code, its pants. Or maybe VBA has attracted the wrong crowd? ;-)

Have you got any plans to check out the SO/OO VBA features? (I believe you can also send them .bas files etc so they can prioritise the stuff people are using).



9 Responses to “OpenOffice VBA”

  1. Marcus Says:

    I recall that Joel Spolsky wrote an article on JoS some time ago which basically stated: Good software takes ten years – get used to it. Ahh, here it is…

    Essentially there is a natural maturation process a software app needs to go through. Or to paraphrase Fred Brooks – no matter how many women you throw at it – it still takes 9 months to make a baby.

    Given that MSO has had well over a decade to mature organically – will it take OS equivalents such as OxygenOffice to become a serious threat? Linux has been around a while. In the early years there was plenty of hype that it was going to take over the desktop. While it’s made inroads to the (web) server market, desktop domination is still a dream.

    And you’re right – VBA was in the right place at the right time and certainly hit a sweet spot. It’s a reasonable balance that was/is fit for purpose. Until my client/work base starts to shift from Excel/VBA. So far there hasn’t even been a hint of it.

    Hmm. I think I went slight OT there.

    Cheers – Marcus

  2. Biggus Dickus Says:

    “I guess its part of the MS philosophy – if its not managed code, its pants. Or maybe VBA has attracted the wrong crowd? ;-)”

    You have a great way of putting things Simon…… Absolutely correct.

    p.s. I didn’t see your name on the list for Sept in Seattle (??)

  3. Dennis Wallentin Says:



  4. Ross Says:

    Good catch Simon, I cant be asked to download it but i do hope they keep working on it, it would be real nice – Going back to your previous post I don’t know why someone doesn’t come up with a rip off of VB6 – there was one Ithink K basic or something, i down loaded it but it was pants, i think it’s dead now anyway. Or maybe that real basic?

    As for:
    >>I recall that Joel Spolsky wrote an article on JoS some time ago which basically stated: Good software takes ten years – get used to it.

    Who am i to disagree with Joel? But, I do. What about Firefox for example – what about Google maps? I don’t agree with that at all.

  5. Simon Says:

    Marcus/Ross SO/OO has been around to a good few years, so that point is moot I would say. ‘Linux desktop domination a dream’ – that may have been true, but I’m sure you’ve read Joels piece on MS losing the win32 API religion. And more recently Mac and Linux are making in-roads. I certainly wouldn’t bet against MS, not yet anyway, but I am watching closely.

    Dick I was thinking of you when I said the wrong crowd ;-) Thanks for the reminder, I’ve just been and registered, I had completely forgotten – I was just going to book the plane and turn up. Doh. (how would I have got my meal choice??)

  6. Biggus Dickus Says:

    “Dick I was thinking of you when I said the wrong crowd ;-) ”

    I resemble that remark ;-)

    Glad you’re not just showing up.. I would’ve given you a bite of my sandwich.


  7. Harlan Grove Says:

    Windows will be the dominant consumer OS until hardware makers release Linux or OS X drivers at the same time as Windows drivers. Until that happens, plug & play favors Windows. As for OS X, I have no idea whether it needs upgraded hardware drivers for every OS X version upgrade as Windows seems to require.

    For large organizations using Citrix or other Terminal Server intermediaries to provide most end-user applications, Linux could already be the OS for diskless desktop machines. Citrix on Linux works just fine.

  8. Marcus Says:

    A generalisation of course, Ross. And like any generalisation, there’ll be exceptions. I think this generalisation goes beyond the product to the product market.

    The office productivity market has reached a level of maturity that the learning curve of what features to include has plateaued. In fact it’s probably going backwards by including feature simply to differentiate from the prior version. Any new entrants into the market are not having to redefine any paradigms, rather mimic and remove the flaws from the existing market players.

    Is anyone aware what market penetration Firefox has? And while it’s interesting, are there any mainstream apps incorporating Google Maps?

    Kind Regards – Marcus

  9. Ross Says:

    Yeah, I kinda see the point too, (maybe i should actually read the article!)

    FF – intresting reading…

    Not sure about Google maps – but i think there wicked!

    This maybe also brings up the point of SW life cycles – excel is a slow burner, it takes a while to mature then stays there for quite a long time – i.e 97 will do for most folks 10 later.

    Compare that with browsers and the internet, the pace of change is much greater, so a “10 year cycle” might take place is a shorter space of time? – some thing like that anyway.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: