I have an empty excel template with multiple sheets. In all the sheets, I have placed the cursor in A1 cell and saved the work book.
Data is populated in the template using c# code and when downloading it, I can see the focus is not set to A1 cells in all the work sheets.
workbook is saved as below in c# code:
MemoryStream memoryStream = new MemoryStream();
if (extension == “.xlsx”)
workBook.Save(memoryStream, SaveFormat.Xlsx);
else if (extension == “.xlsm”)
workBook.Save(memoryStream, SaveFormat.Xlsm);
memoryStream.Seek(0, SeekOrigin.Begin);
Empty template:
image.png (28.7 KB)
Downloaded excel after populating data:
image.png (35.6 KB)
Do I have explicitly set the focus for each worksheet? what function of aspose cell can be used?