Hi All, I want to use POI to programmatically edit an Excel document that is managed by Microsoft SharePoint. Typically, I use an application which captures some data and then I manually edit the Excel file to input the values before committing the changes to SharePoint. I want to automate this data entry process.
The challenge that I'm facing with using POI right now is opening up the SharePoint managed Excel file for reading/writing. I tried to use the "save workspace" option in Excel, which generates a "*.xlw" file (versus the normal Excel "*.xls" file). This is great if I want to manually reopen the file later to synchronize changes with SharePoint. However, when I tried to use POI to open an InputStream, an error occurred. ======== java.io.IOException: Unable to read entire header; 358 bytes read; expected 512 bytes at org.apache.poi.poifs.storage.HeaderBlockReader.alertShortRead(HeaderBlockReader.java:130) at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:94) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:151) ======== Is there a way that I can accomplish the goal of programmatically editing a SharePoint managed Excel document? The only other solution I can think of that would work would be to save a local copy of the Excel file, then use POI to push the data into it. Then manually open the local copy and do a copy/paste of the worksheet onto the SharePoint document. I'm not sure this way would be worth it though. Thanks, Burt
