我使用 exceljs Node 模块并添加下拉数据验证
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.
如何解决这个问题?
最佳答案
在数据验证公式中反引号。它只支持和识别另一个。
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"
};
关于node.js - Exceljs数据验证列表导致Excel女士出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48019987/