read in from read only xlsm file using java apache poi -



read in from read only xlsm file using java apache poi -

i'm trying read info read xlsm using java apache poi, when utilize xssf workbook doesn't seem able access file , hssf workbooks work xls files. code looks this:

try { fileinputstream file = new fileinputstream(new file("file.xlsm")); system.out.println("found file"); xssfworkbook workbook = new xssfworkbook(file); system.out.println("in workbook"); xssfsheet sheet = workbook.getsheet("shipments"); system.out.println("got sheet");

the code never reaches "in workbook" print line , i'm not sure why. please help!

i copied code , gave file proper path , worked.

my version:

fileinputstream file = new fileinputstream(new file("c:\\users\\user\\desktop\\filet.xlsm")); system.out.println("found file"); xssfworkbook workbook = new xssfworkbook(file); system.out.println("in workbook"); xssfsheet sheet = workbook.getsheet("shipments"); system.out.println("got sheet");

i think has pathing, or file itself.

java file-io apache-poi xlsx

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -