C#用EPPLUS读写Excel单元格时,有的单元格能读,但写不进去,重新也不报错,该怎么解决?

excel表格的B1单元格能读出数据,但写不进去

using (ExcelPackage resultExcel = new ExcelPackage(new FileInfo(@"..\..\出货报告\" + textBox1.Text + ".xlsx")))
                        {
                            ExcelWorksheet resultWS = resultExcel.Workbook.Worksheets["出货报告"];//目标工作表格
                            MessageBox.Show(((string)(resultWS.Cells["B1"].Value)).Replace("****", "P20"));
                            resultWS.Cells["B1"].Value = ((string)(resultWS.Cells["B1"].Value)).Replace("****", "P20");
                            resultWS.Cells["B1"].Style.Font.Name = "Arial";
                            resultWS.Cells["B1"].Style.Font.Bold = true;
                            resultWS.Cells["B1"].Style.Font.Size = 18;
                            resultWS.Cells["B1"].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
                            resultWS.Cells["B1"].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
                            resultWS.Cells["B1"].Style.WrapText = true;
                            resultWS.Column(11).Width = 50;
                            resultExcel.Save();
                        }
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐