English 中文(简体)
我正试图拿外衣,根据一栏的价值,过滤一只囚室,但一只留下错误。 什么是错了?
原标题:I am trying to get excelscript to filter out a bunch of rows based on the value in one column, but i keep getting an error. What did i do wrong?

我正试图通过使用外壳体自动特征的外壳体的外壳体的外壳器对扫描器的投入进行自动交换。 我需要删除低于和超过一定范围的一切。 我正试图使用一个海关过滤器,检查范围外的一切情况,并删除所有这些行文。 我试图简明扼要地做这项工作,然后再把它扔进一个大的文字中,进行全面分析,撰写文字。 全文如下:

function main(workbook: ExcelScript.Workbook) {
    let selectedSheet = workbook.getActiveWorksheet();
    // Toggle auto filter on selectedSheet
    selectedSheet.getAutoFilter().apply(selectedSheet.getRange("A:A"));
    // Apply custom filter on selectedSheet
    selectedSheet.getAutoFilter().apply(selectedSheet.getAutoFilter().getRange(), 1, { filterOn: ExcelScript.FilterOn.custom, criterion1: "<9", criterion2: ">30", operator: ExcelScript.FilterOperator.or });
    // Delete all cells on selectedSheet
    selectedSheet.getRange().delete(ExcelScript.DeleteShiftDirection.up);
}

我所看到的错误是:

论点无效或缺失,或格式不正确。

如同6岁一样,长者认为一行两度相同。

我在标准上不与yn合,而是一只 have子。

问题回答
  • OfficeScript (TypeScript) uses zero-base index. The 2nd argument of getAutoFilter().apply() should be zero in your code.
function main(workbook: ExcelScript.Workbook) {
    let selectedSheet = workbook.getActiveWorksheet();
    // Toggle auto filter on selectedSheet
    selectedSheet.getAutoFilter().apply(selectedSheet.getRange("A:A"));
    // Apply custom filter on selectedSheet
    const criterion = { 
        filterOn: ExcelScript.FilterOn.custom, 
        criterion1: "<9", 
        criterion2: ">30", 
        operator: ExcelScript.FilterOperator.or };
    selectedSheet.getAutoFilter().apply(selectedSheet.getAutoFilter().getRange(), 0, criterion);
}




相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签