title: Explicitly set a cell’s datatype as text for number values
body: <p>I want to explicitly set a cell’s datatype as a text for number values.</p>
  
  <p>I am fetching data from my MySQL database and exporting to excel file using PHPExcel Library. I have large about 20 digit long numbers which I want to export to excel cell(each cell of the entire column will have different numbers).</p>
  
  <p>I have found that you can do this by code mentioned PHPExcel Documentation 4.6.7.</p>
  
  <pre><code>$i=0;
  foreach($dd as $d) {
      $objPHPExcel
          -&gt;setActiveSheetIndex(0)
         -&gt;getcell('A'.$i)
         -&gt;setValueExplicit($d['serial_no'], PHPExcel_Cell_DataType::TYPE_STRING);
      $i++;
  }
  </code></pre>
  
  <p><code>$d['serial_no']</code>-different serials coming from database e.g."9876543211234567890".</p>
  
  <p>I have implemented this code its working fine. But when I open that excel sheet and try to modify that cell then click on anywhere else it again gets converted to number format(client's requirement: it should remain as text).</p>
  
  <p>I want to stay that cell as text even if I edit in it.</p>