title: Reading a macro file and writing a excel file inside java application using poi
body: <p>I want a solution for reading a macro enabled(.xlsm) file and write the contents on a excel file.</p>
  
  <p>I have tried out things as following.</p>
  
  <pre><code>String fileName = "sample.xlsm";
  String path = "../documents/macro_CleanUp.xlsm";
  OPCPackage pkg = OPCPackage.open(new File(path));
  XSSFWorkbook wb_template = new XSSFWorkbook(pkg);
  SXSSFWorkbook workbook = new SXSSFWorkbook(wb_template);
  workbook.setCompressTempFiles(true);
  SXSSFSheet sheet = (SXSSFSheet) workbook.createSheet(fileName);
  //filling contents of sheet
  response.setContentType("application/octet-stream");            response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName);            OutputStream out = response.getOutputStream();
  workbook.write(out);
  out.flush();
  out.close();
  </code></pre>
  
  <p>This works when i run in my localhost. but it doesnt work when i deploy the application into the server.</p>
  
  <p>Can anyone tell where i am going wrong.</p>