Microsoft open xml converter office 2002 code#
![microsoft open xml converter office 2002 microsoft open xml converter office 2002](https://www.lifewire.com/thmb/YjEpJaL1meyJs3wvp7E0SV8G2ow=/597x597/smart/filters:no_upscale()/libreoffice-download-page-add3d4fc6ed14fb2b7f13a3fa8351225.png)
![microsoft open xml converter office 2002 microsoft open xml converter office 2002](https://cdn.techjourney.net/2007/10/powerpoint-export-video.png)
If you have access to OpenOffice, it has a rather good API that is accessible from Java code.As above, POI can be used to process the file following the conversion. If you are running on a stand alone PC on which a copy of Excel is installed and using the Windows operating system, then you could use OLE to do something very similar from Java code.Then once the file has been converted wither to the binary or OpenXML formats, POI can be used to process it. This way you could automate a file conversion process using Excel itself. If you have access to Visual Studio and can write Visual Basic or C# code then you could use a control that will allow you to control Excel programmatically.You could use Excel itself and manually open and save each file you wish to convert, as you already have done.Sadly, POI cannot interpret this file at all and that is why you saw the exception when you tried to wrap it up in the InputStream and pass it to WorkbookFactory(s) constructor. You have got an Office 2003 xml file there, not an OpenXML file it is an early attempt by Microsoft to create an xml based file format for Excel and it is in that sense a 'valid' Office file format.
![microsoft open xml converter office 2002 microsoft open xml converter office 2002](https://www.lifewire.com/thmb/b7lc6dLoMlXbjUxNblrW1tibyb8=/889x667/smart/filters:no_upscale()/docx-file-2620750-ADD-Final-V2-6f9e16b8aeaa4ba0a98afdfe62ae1172.gif)
Copying Mark Beardsley's answer from POI team :