【问题标题】:Exceljs data validation list cause error in Ms. ExcelExceljs数据验证列表导致Excel女士出错
【发布时间】:2020-01-04 04:13:57
【问题描述】:

我使用 exceljs 节点模块并添加下拉数据验证

worksheet.getCell(cell).dataValidation = {
  type: 'list',
  allowBlank: true,
  formulae: ['"One,Two,Three,Four"'],
  showErrorMessage: true,
  errorStyle: 'error',
  errorTitle: 'Error',
  error: 'Value must be in the list'
};

文件成功生成。但它只能使用 Libre Office 打开。用Office女士打开文件会出现如下错误:

Excel completed file level validation and repair.
Some parts of this workbook mau have been repaired or discarded.
Repaired Part: /xl/worksheets/sheet1.xml part.

如何解决这个问题?

【问题讨论】:

    标签: node.js exceljs


    【解决方案1】:

    在数据验证公式中反转引号。它只支持和识别另一个

    worksheet.getCell(cell).dataValidation=
    {
        type : "list",
        allowBlank : true,
        formulae : ["'One,Two,Three,Four'"],//<--------------------------------Right there
        showErrorMessage : true,
        errorStyle : "error",
        errorTitle : "Error",
        error : "Value must be in the list"
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多