title: Can I open a xlsx file with application/vnd.openxmlformats-officedocument.spreadsheetml.sheet?
body: <p>I want to open a <code>xlsx</code> file with PHP using <code>application/vnd.openxmlformats-  officedocument.spreadsheetml.sheet</code> because COM does not work on the server.<br>
  Does someone know how to do this?</p>
  
  <p>The commented section is the one I want to replace. I am doing this to force excel to calculate the values in the formulas because phpexcel is not getting the correct values.</p>
  
  <p>If there a way to configure the COM to run in the server please let me know.</p>
  
  <p>This is my code:</p>
  
  <pre><code>$inputFileName = 'FORMATO PEDIDO.xlsx';
                          $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
  
                          $objPHPexcel = PHPExcel_IOFactory::load($inputFileName);
                          $objWorksheet = $objPHPexcel-&gt;setActiveSheetIndex(0);
                          $objWorksheet = $objPHPexcel-&gt;getActiveSheet(); 
  
                          $claves = $_POST['claves'];
                          $checked = $_POST['productos'];
                          $cantidades = $_POST['pallet'];
                          $id_sucursal_seleccionada = $_POST['recibe_sucursal'];
                          $sql_query = mysql_query("SELECT * FROM sucursal WHERE Id_Sucursal = '$id_sucursal_seleccionada'");
                          $sql_array = mysql_fetch_array($sql_query);
                          $nombre_sucursal = $sql_array['Nombre'];
                          $i=0;
                          $j=22;
                          foreach($claves as $clave_producto)
                          {
                              if($checked[$i])
                              {
                                  $cantidad = $cantidades[$i];
                                  $objWorksheet-&gt;getCell('B'.$j)-&gt;setValue($clave_producto); 
                                  $objWorksheet-&gt;getCell('F'.$j)-&gt;setValue($cantidad);
                                  $j++;
                              }
                              $i++;
                          }
                          $objWriter = PHPExcel_IOFactory::createWriter($objPHPexcel,$inputFileType); 
                          $objWriter-&gt;setPreCalculateFormulas(false);
                          $objWriter-&gt;save($inputFileName); 
  
                          $workbook = "C:/Documents and Settings/sosam1/My Documents/Dropbox/htdocs/Merdiz/inventarios/FORMATO PEDIDO.xlsx";
                          $ex = new COM("Excel.application") or Die ("Did not connect");
                          $wkb = $ex-&gt;application-&gt;Workbooks-&gt;Open($workbook) or Die ("Did not open");
                          $ex-&gt;Application-&gt;ActiveWorkbook-&gt;Save();
                          $ex-&gt;application-&gt;ActiveWorkbook-&gt;Close("False");    
  
                          $objPHPexcel = PHPExcel_IOFactory::load($inputFileName);
                          $objWorksheet = $objPHPexcel-&gt;setActiveSheetIndex(0);
                          $objWorksheet = $objPHPexcel-&gt;getActiveSheet();
  </code></pre>