Incorporate excel file to project directory wpf c#
<p>I have some information stored in an excel file and I want to read them from a Wpf application. I'm able to read from this file in this way:</p>

<pre><code>foreach (var worksheet in Workbook.Worksheets("ExcelFile.xlsx") )
        {
            for (int j = 1; j &lt; 30; j++)
            {
                _Data.Add(new Data
                {  FirstElement = worksheet.Rows[j].Cells[0].Text.ToString(), });
            }
        }
</code></pre>

<p>Where ExcelFile.xlsx is a file saved in the Solution Folder and set as Incorporated Resource. 
If I start the application directly from Visual Studio it works but if I copy the compiled .exe file and I send it to someone, it doesn't work because the xlsx file is missing.</p>

<p>My question: is there a way to incoporate the xlsx file into the .exe file so that I can share only the .exe file and everything works?
Why setting the ExcelFile.xlsx file as "<strong>incorporated Resource</strong>" is not working as I thought?</p>

<p>thanks for your help!</p>