title: Add image from a folder to Excel worksheet
body: <p>I want to export all images from my image folder into Excel. I want to place every image in the image folder into a new excel worksheet. For example if there are ten images in the folder, I want to have ten Excel worksheets on the same Excel workbook with one image on each worksheet.</p>
  
  <p>This is my code:</p>
  
  <pre><code>    string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/Image"));
                  int count = 0;
                  foreach (string img in filesindirectory)
                  {
                      count++;
                   ExcelWorksheet ws = objExcelPackage.Workbook.Worksheets.Add("Worksheet - " + count); //create new worksheet
                      System.Web.UI.WebControls.Image TEST_IMAGE = new System.Web.UI.WebControls.Image();
                      TEST_IMAGE.ImageUrl = "Image/" + Path.GetFileName(img);
                      TEST_IMAGE.ImageUrl = this.GetAbsoluteUrl(TEST_IMAGE.ImageUrl);
  
                     //I want to insert image here
  
  var filepath= new FileInfo(@"C:\Users\user\Desktop\folder\" + datetime.ToString("dd-MM-yyyy_hh-mm-ss") + ".xlsx");
                          objExcelPackage.SaveAs(filepath);
  </code></pre>
  
  <p>This is my updated code:</p>
  
  <pre><code>string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/Image"));
          int count = 0;
          foreach (string img in filesindirectory)
          {
              count++;
              ExcelWorksheet ws = objExcelPackage.Workbook.Worksheets.Add("Worksheet - " + count); //create new worksheet
              System.Web.UI.WebControls.Image TEST_IMAGE = new System.Web.UI.WebControls.Image();
              var filedest = new FileInfo(@"C:\Users\user\Desktop\Project\Project1\Source Code\Test\Test\Image\");
              System.Drawing.Image myimage = System.Drawing.Image.FromFile(filedest);
              var pic = ws.Drawings.AddPicture("NAME", myimage);
  
              var filepath = new FileInfo(@"C:\Users\user\Desktop\folder\" + datetime.ToString("dd-MM-yyyy_hh-mm-ss") + ".xlsx");
              objExcelPackage.SaveAs(filepath);
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <blockquote>
    <p>FileNotFoundException was unhandled by user code</p>
  </blockquote>
  
  <p>, on this line:</p>
  
  <pre><code>var filedest = new FileInfo(@"C:\Users\user\Desktop\Project\Project1\Source Code\Test\Test\Image\");  
  </code></pre>
  
  <p>How to add image from a folder to Excel worksheet using EPPlus with my current code?</p>