'How to export excel with image from gridview in c# winform

I have database that have image path but when we export excel from gridview then image should be show in excel cell we attach image for exampleenter image description here

[enter image description here]enter image description here3

try
        {
            Microsoft.Office.Interop.Excel.Application xlApp;
            Workbook xlWorkBook;
            Worksheet xlWorkSheet;
            object misValue = System.Reflection.Missing.Value;
            int[] ColumnsToInclude = { 0, 1, 16, 7, 8, 19, 9, 10, 17 };
            Int16 i;
            xlApp = new Microsoft.Office.Interop.Excel.Application();
            xlWorkBook = xlApp.Workbooks.Add(misValue);
            xlWorkSheet = (Worksheet)xlWorkBook.Worksheets.get_Item(1);
            for (int ix = 0; ix < ColumnsToInclude.Length; ix++)
            {
                xlWorkSheet.Cells[1, ix + 1] = dgvSummaryReport.Columns[ColumnsToInclude[ix]].HeaderText;
            }
            for (i = 0; i <= dgvSummaryReport.RowCount - 1; i++)
            {
                for (int j = 0; j < ColumnsToInclude.Length; j++)
                {
                    xlWorkSheet.Cells[i + 2, j + 1] = dgvSummaryReport[ColumnsToInclude[j], i].Value.ToString();
                }
            }
            xlWorkBook.SaveAs("H:\\" + DateTime.Now.ToString("ddMMyyyyhhmmss") + "_List of ocuupier detail for biometric  survey" + ".xls", XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
            MessageBox.Show("File Created Successfully.in this location.");
            xlWorkBook.Close(true, misValue, misValue);
            xlApp.Quit();
            releaseObject(xlWorkSheet);
            releaseObject(xlWorkBook);
            releaseObject(xlApp);
        }
        catch (Exception ex)
        {
            string strCurrentMethod = System.Reflection.MethodBase.GetCurrentMethod().Name;
            strCurrentMethod = this.GetType().Name + " - " + strCurrentMethod;
            ErrorLog.WriteTextFile(strCurrentMethod, ex.Message);
            MessageBox.Show("Please check error log.", "ErrorLog", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }enter code here


[enter code here][4]


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source