Write array formula
Command Description
Write the array formula to the specified cell or range in the worksheet
Command Prototype
Excel.WriteFormulaArray(objExcelWorkBook,sheet,selectRange,formulaArray,bSave)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
objExcelWorkBook | True | expression | objExcelWorkBook | Workbook objects returned by the Open Excel Workbook command (Excel. Open) or Bind Excel Workbook command (Excel. BindBook) |
sheet | True | string | "Sheet1" | If a string is used, it represents the name of the specified worksheet; Using numbers indicates the order of the specified worksheet (starting from 0) |
selectRange | True | string | "A1" | The write range can be a specified cell (suitable for only one output result), supporting both cell names (such as "A1") and row column arrays (such as [row number, column number]), and cell names are not case sensitive; Simultaneously supporting specified regions (suitable for having more than one output result), such as "A1:A8" |
formulaArray | True | string | "" | Array formula, for example: "=SUM (A1:A18+ B1:B18)" |
bSave | True | boolean | False | Do you want to save immediately after completing the operation |
Return result
Run instance
/*********************************Write Array Formula**************************************
Command Prototype:
Excel.WriteFormulaArray(objExcelWorkBook,sheet,selectRange,formulaArray,bSave)
Input Parameters:
objExcelWorkBook -- Workbook object. Note: The workbook object returned by the "Open Excel Workbook" command (Excel.Open) or the "Bind Excel Workbook" command (Excel.BindBook).
sheet -- Worksheet. Note: If using a string, it represents the name of the specified worksheet; if using a number, it represents the index of the specified worksheet (starting from 0).
selectRange -- Write range. Note: The write range can be a specified cell (suitable for single output results), supporting both cell names (e.g., "A1") and row-column arrays (e.g., [row number, column number]), with cell names being case-insensitive. Also supports specified ranges (suitable for multiple output results), such as "A1:A8".
formulaArray -- Array formula. Note: Array formula, for example: "=SUM(A1:A18+B1:B18)".
bSave -- Save immediately. Note: Whether to save immediately after the operation.
Output Parameters:
None
Notes:
None
********************************************************************************/
Excel.WriteFormulaArray(objExcelWorkBook,"Sheet1","A1","",False)