You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by anthony berglas <an...@berglas.org> on 2019/04/25 01:57:08 UTC

How to create a POI VBAMacroReader(POIFSFileSystem fs)

I currently have working code that does

     pkg = OPCPackage.open(stream);
     // process worksheets in pkg...
     mr = new VBAMacroReader(stream);
     // process macros

The problem is that the first call reads stream, and the second then cannot
read it.  Work around is to create multiple BufferedInputReaders which
works but is obviously all wrong.  Why scan the pkg twice in the first
place?

What I should be doing is calling

    new VBAMacroReader(pkg.somehowGetPOIFSFileSystem())

However, it is not at all clear what somehowGetPOIFSFileSystem() should be.
(I only have a stream as source, not a file, it is coming over the
network.  Only needs to work for .xlsm, not .xls.  But obviously the macro
part is binary.)
Any help appreciated.

Anthony

-- 

Dr Anthony Berglas, anthony@berglas.org       Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that that is the best way to collect firewood.