From user-return-23408-archive-asf-public=cust-asf.ponee.io@poi.apache.org Thu Apr 25 11:37:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id AE4AC180638 for ; Thu, 25 Apr 2019 13:37:01 +0200 (CEST) Received: (qmail 61606 invoked by uid 500); 25 Apr 2019 11:36:58 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Delivered-To: moderator for user@poi.apache.org Received: (qmail 58214 invoked by uid 99); 25 Apr 2019 01:57:47 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.8 X-Spam-Level: * X-Spam-Status: No, score=1.8 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=berglas.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=berglas.org ; s=default; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Ldp0+OOkt8NSaPUgmn8FBD2SqoGeQ0wsv9PR39j2Gdw=; b=L6X1SZ1GgrIt2wPh7JrYXB39JU XcVNcUvmBKjvK1eyIAjLjx7jsNuh2DOO96Ky1XUda6amnVopdln/S55hJkUxmfG+uBrNfTjopm5lk ZlQt6csVlJMtrhNiWZio4uW4aED1zdjeaLWaKBpRwgLnluCYrCe9TKjs9SV1XLpNX7VBcVF54Jjrk cLrFup1ZLZRLMxNBR5QhirgPQGf01flciVv+67g+6A6GiECUJB7T4wiZ7qrz/6L60eSYlxnA73iP9 TulNGdh6LFYvOwN5NQESzin9Tbzv/NkVK3/UwYASXn3uX1lpkDJDe58Jyg4iSgu0IqxZ+kJ11N0VJ G5wkt+vQ==; X-Gm-Message-State: APjAAAVUAsS9XRsQucgkrgbONqCirds9CEAId3x47gxRqZlTpED0VR6L PZlrdG9Tkm1XGUjmWdt4LKllopdF+/EVXCc38+g= X-Google-Smtp-Source: APXvYqz+JRhbrz8dEF0IZGokt3/61qBwE51lWqCP/ZUp7gymLjRQ8yhhIGhYJfU6sL0blMp+9Xc7kLJjFOyivdkzXi0= X-Received: by 2002:ac2:5609:: with SMTP id v9mr1114822lfd.159.1556157461420; Wed, 24 Apr 2019 18:57:41 -0700 (PDT) MIME-Version: 1.0 From: anthony berglas Date: Thu, 25 Apr 2019 11:57:08 +1000 X-Gmail-Original-Message-ID: Message-ID: Subject: How to create a POI VBAMacroReader(POIFSFileSystem fs) To: user@poi.apache.org Content-Type: multipart/alternative; boundary="000000000000b3e1c9058751249a" X-LinkSkyHosting-MailScanner-Information: Please contact the ISP for more information X-LinkSkyHosting-MailScanner-ID: 1hJTdu-002js5-Oa X-LinkSkyHosting-MailScanner: Found to be clean X-LinkSkyHosting-MailScanner-SpamCheck: X-LinkSkyHosting-MailScanner-From: anthony@berglas.org X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - equinox.linksky122.com X-AntiAbuse: Original Domain - poi.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - berglas.org X-Get-Message-Sender-Via: equinox.linksky122.com: authenticated_id: aberglas/from_h X-Authenticated-Sender: equinox.linksky122.com: anthony@berglas.org --000000000000b3e1c9058751249a Content-Type: text/plain; charset="UTF-8" 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. --000000000000b3e1c9058751249a--