[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: Reasons for not supporting Macros in Apache POI
From:       Ken McWilliams <ken.mcwilliams () gmail ! com>
Date:       2015-02-17 19:50:58
Message-ID: CAPcVg7=1wg1ZF5bYRMxwA74crS2hVtPO-NhW0ySpBzhM_uwzLg () mail ! gmail ! com
[Download RAW message or body]


It might be worth looking a LibreOffice (UNO) to see what they offer.
LibreOffice can run VB Macros, so there is freely available code there. I
think LibreOffice is more feature rich, however there is a reason so many
people use Apache POI.

What you would expect to be easy in POI is really quite easy. The pain in
using UNO should not be underestimated! All kinds of casting was required
(I think that has been reduced do to generics but still you need to know
the factory return types) all kinds of obscure factory objects need to be
used, and trying to figure out what factory is needed... the documentation
is wrenched. Because of its design there is no support from the IDE in
discovering what you need.

UNO has binding for many languages letting all languages use
OpenOffice/LibreOffice equally poorly. If they had taken a Java first
mentality the capabilities would be far beyond what POI offers (in terms of
document creation and manipulation, although clearly not as light weight -
you are working though the OO server after all), and ironically most other
languages would likely have an easier time using their APIs (particularly
languages which people tend to program business applications). Also because
you need to know the installation path the solutions are not very portable.

The support for macros is good but not perfect. If the macros don't work in
LibreOffice and it isn't expected that it would be trivial to correct for
this, then that would not be an option anyways.

On Tue, Feb 17, 2015 at 11:41 AM, Amandeep Gautam <amandeepgautam5@gmail.com
> wrote:

> Hi Andreas,
>     We have not started working on the project yet. We are still in scoping
> stages and I am trying to finalize the milestones that we will have to
> achieve. I think starting with support of importing and exporting the
> macros would be a good as we will gain a understanding of the existing code
> base (as we have never contributed before).
>     Let me know your thoughts on this. Suggestions are welcome.
>
> Thanks,
> Aman
>
> On Tue, Feb 17, 2015 at 12:12 AM, Andreas Beeker <andreas.beeker@gmx.de>
> wrote:
>
> > Hi Aman,
> >
> > > Support for
> > > Importing/exporting/creating macros from java will make the tool a lot
> > more
> > > maintainable and reduce operation load as well.
> > Importing and exporting seems to be not so complicated, i.e. in xlsx it's
> > a .bin file, which needs to be imported and linked.
> > But creating needs an implementation of OVBA [1] - is creating really
> > necessary, or can you live with importing a predefined binary from
> Office?
> >
> > How far is your implementation? How do you cope with that issue up till
> > now?
> >
> > I only had a quickview over OVBA, but it looks like, there is no
> > compilation necessary, just a bit of source (de-)compression.
> >
> > Apart of that, I inline here my private response to you, as I think, this
> > still applies: "...
> >
> > > Why does POI does not support Macros? Any specific reasons?
> > Although I could guess, that would probably be not the reason ... if a
> > feature is not strongly demanded, it usually
> > drops from the interest list and for new features, either its in the
> > interest of one of the committers to develop it
> > or we get a ready-to-merge patch
> >
> > > What are the high level milestones that need to be done in case someone
> > wants this to be implemented?
> > Afaik we don't work with milestones - I guess the support within XSSF is
> > much easier, so I would start there.
> >
> > > We are a group (3-4) of developers who want to contribute to open
> source
> > and this is a problem we face at work.
> > > ... but macros are kind of black box from the code (over a period of
> > years have becoming non maintainable for us).
> > Sounds good - when you say it's a black box from the code, that means you
> > can't simply safe a xlsx with macros,
> > compare and add the necessary parts with POI?
> > I.e. do you want to create a specific vbaproject.bin for every file or
> can
> > use a predefined (pre-exported from Office)?
> >
> > ..."
> >
> > Best wishes,
> > Andi
> >
> >
> > [1] https://msdn.microsoft.com/en-us/library/cc313094(v=office.12).aspx
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
> >
> >
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic