title: Set DataType in Excel Cell using OfficeOpenXml in C#
body: <p>I am using the OfficeOpenXml library to create Excel files in C#. Specifically, I need to set the datatype of a specific cell to EUR programmatically. For example 1234.5 must be turned into 1234.5 €.</p>
  
  <p>With the UI, this operation is fairly easy RightClick -->Format Cells --> Number --> Currency --> Symbol  (see attached image). <a href="https://i.stack.imgur.com/pr1Mt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pr1Mt.png" alt="enter image description here"></a>. </p>
  
  <p>Below is my code. Any clue on how to do that? </p>
  
  <pre><code>string fullpath = @"\\SOME_PATH\test_file.xlsx";
  
  // if file exists, overwrite
  if (File.Exists(fullpath))
      File.Delete(fullpath);
  
  var pck = new ExcelPackage(new FileInfo(fullpath));
  
  var workSheet = pck.Workbook.Worksheets.Add("contract summary");
  
  workSheet.Cell(1, 1).DataType = "Currency"; // this does not work.
  
  workSheet.Cell(1, 1).Value = 1234.5.ToString();
  </code></pre>