tags:

views:

130

answers:

1

I opened some xlt-file with Apache POI, changed it and saved it as xls-file.

But if I open result xls-file with Excel and click File -> Save as... the type of file still will be Template *.xlt.

So I need to save xlt-file as xls (not only change name, but format).

Used code:

HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream("D:\\Template.xlt"));
// ...
workbook.write(new FileOutputStream("D:\\Result.xls"));
A: 

Answered: http://stackoverflow.com/questions/714172/poi-using-excel-templates

Sugerman
I wrote in my question my current code (which is identical with answer for question you wrote). But it does not work. It just renames file from ".xlt" to ".xls" and does not change internal format. MS Excel still says that it is template file.
2PaVeL