Dim opts As ErrorCheckOptionCollection = workBook.Worksheets(0).ErrorCheckOptions
Dim index As Integer = opts.Add()
Dim opt As ErrorCheckOption = opts(index)
opt.SetErrorCheck(ErrorCheckType.TextNumber, False)
在代码上方,用于ErrorCheckOption
在 Excel 中禁用,但在运行时仍保持启用状态。下载 excel 表后,如果我们双击单元格,单元格将显示为绿色(即文本格式),您能否建议任何替代方案。我附上了截图供您参考。