poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthony berglas <anth...@berglas.org>
Subject How to create a POI VBAMacroReader(POIFSFileSystem fs)
Date Thu, 25 Apr 2019 01:57:08 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message