Hi Team,
I am trying to read and update my .xlsb binary excel file with Spire.xls. Post updating the file it is giving below popup of "Error with content"
My application is .net core with .net 5.0 framework within windows 11
I am using Spire.xls 13.3.2.0 downloaded from Nuget
Below is the code I have used.
private void ReadFilewithSpire() {
// Directory path of input and output files.
string dirPath = "B:\\Census upload project/";
Workbook workbook = new Workbook();
workbook.LoadFromFile(dirPath + "InputLargeGroupModel_UW1_Test.xlsb");
//Edit Text
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["D2"].Text = "Kelly Cooper";
sheet.Range["D2"].Style.Font.FontName = "Arial Narrow";
sheet.Range["D2"].Style.Font.Color = Color.DarkBlue;
//Edit Cell Value
sheet.Range["E2"].Value = "00-1-285-7901742";
sheet.Range["E2"].Style.Font.FontName = "Book Antiqua";
sheet.Range["E2"].Style.Font.Color = Color.DarkOrange;
string data = sheet.Range["E72"].Value;
Worksheet sheet2 = workbook.Worksheets["Additional Prospect Inputs"];
sheet2.Range["B5"].Value = data;
//Save and Launch
workbook.SaveToFile(dirPath + "InputLargeGroupModel_UW1_Test.xlsb", ExcelVersion.Xlsb2010);
//System.Diagnostics.Process.Start(dirPath + "InputLargeGroupModel_UW1_Test.xlsb");
}
Attached is the input file I am using to update and error popup screenshot.
Please do let me know if you need anything else.
Thanks and regards
Heeralal Tiwari
Empoweredmargins Pvt. Ltd.