Hi.
I’m trying to create 2-sheet xlsx file. First sheet is calculated data, second one is from App_data file.
When I get the resulting Excel from my web application, I see that BOTH sheets are selected, and if I try to amend first, cell in the second one also get amended.
I tried 20+ workarounds to deselect it, no success.
Please help.
new License().SetLicense(licFile);
// wbook contains sheet[0] with some data.
if (wbook.Worksheets.Count < 1)
{
throw new UserException(“Uploaded file should have at least one work sheet.”);
}
try
{
var glossary = new Workbook();
glossary.Open(HttpContext.Current.Server.MapPath("~/App_Data/BBAGlossary.xlsx"));
wbook.Worksheets[wbook.Worksheets.Add(“Attributes Glossary”).Index].Copy(glossary.Worksheets[0]);
}
catch(Exception e)
{
throw new UserException(“Cannot add Attribute Glossary”, e);
}
// after that sheets[0] and [1] both are selected in output