Hi!
 
I'm using the below code to bring text from Excel to Java:
 
XSSFWorkbook wb = new XSSFWorkbook("C:/myDocument.xlsm"); 
XSSFSheet sheet = wb.getSheet("Sheet1");
Row firstRow = sheet.getRow(0);
System.out.println(firstRow.getCell(0).getRichStringCellValue().getString())
 
If I run the above program and terminate it, I am able to save myDocument.xlsm. 
However, if I run the program without terminating it (i.e. I let it continue 
running other code), I am not able to save myDocument.xlsm!
 
If I try doing so, I get an error message telling me that the document can't be 
saved because of a sharing error and that I should try saving it to another 
file. Can anything be done to prevent this error?
 
Best regards,
Sul Adna


      

Reply via email to