I am trying to create an XLSB file and then import it into MS-Access
Please see the below java code snippet
public static void main(String args[]) throws Exception
{
String OutfileName = “Test.xlsb”;
String sFilePath = “D:/Test”+OutfileName;
Workbook workbook = new Workbook();
Object data[][] = new Object[1][1];
data[0][0]=“test”;
Worksheet works = workbook.getWorksheets().get(0);
works.getCells().importTwoDimensionArray(data, 0, 0,false);
workbook.save(sFilePath,SaveFormat.XLSB);
}
This code gives me the XLSB file which i can open using MS-Excel 2016 but cannot import it into MS-Access 2016.
Get an error.
“System resources exceeded”.
Therefore i changed the save call in the above code as:
workbook.save(sFilePath,SaveFormat.XLSX);
Now i am able to import the file in MS-Access 2016 as required but now unable to open it into excel.
It gives error
Excel cannot open the file ‘Test.xlsb’ because the file format or extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.
Note:Jar used is aspose.pdf-17.2.0.jar
I need the fix or resolution for the issue asap.