Skip to content

[admin] Publish #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ methods:
uid: 'ExcelScript!ExcelScript.ChartPoint#getMarkerSize:member(1)'
package: ExcelScript!
fullName: getMarkerSize()
summary: Represents marker size of a data point.
summary: >-
Represents marker size of a data point. The supported size range is 2 to 72. This method returns an
InvalidArgument error if it's set with a size outside of the supported range.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down Expand Up @@ -168,7 +170,9 @@ methods:
uid: 'ExcelScript!ExcelScript.ChartPoint#setMarkerSize:member(1)'
package: ExcelScript!
fullName: setMarkerSize(markerSize)
summary: Represents marker size of a data point.
summary: >-
Represents marker size of a data point. The supported size range is 2 to 72. This method returns an
InvalidArgument error if it's set with a size outside of the supported range.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,9 @@ methods:
uid: 'ExcelScript!ExcelScript.ChartSeries#getMarkerSize:member(1)'
package: ExcelScript!
fullName: getMarkerSize()
summary: Specifies the marker size of a chart series.
summary: >-
Specifies the marker size of a chart series. The supported size range is 2 to 72. This method returns an
InvalidArgument error if it's set with a size outside of the supported range.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down Expand Up @@ -1236,7 +1238,9 @@ methods:
uid: 'ExcelScript!ExcelScript.ChartSeries#setMarkerSize:member(1)'
package: ExcelScript!
fullName: setMarkerSize(markerSize)
summary: Specifies the marker size of a chart series.
summary: >-
Specifies the marker size of a chart series. The supported size range is 2 to 72. This method returns an
InvalidArgument error if it's set with a size outside of the supported range.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,32 @@ uid: 'ExcelScript!ExcelScript.ConditionalFormatRule:interface'
package: ExcelScript!
fullName: ExcelScript.ConditionalFormatRule
summary: 'Represents a rule, for all traditional rule/format pairings.'
remarks: ''
remarks: |-


#### Examples

```TypeScript
/**
* This script applies a custom conditional formatting to the selected range.
* A light-green fill is applied to a cell if the value is larger than the value in the row's previous column.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the selected cells.
let selectedRange = workbook.getSelectedRange();

// Apply a rule for positive change from the previous column.
let positiveChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);

// Set the conditional format to be a lightgreen fill.
let positiveCustom: ExcelScript.CustomConditionalFormat = positiveChange.getCustom();
positiveCustom.getFormat().getFill().setColor("lightgreen");

// Set the conditional rule to be if there is positive change across the row.
let positiveRule: ExcelScript.ConditionalFormatRule = positiveCustom.getRule();
positiveRule.setFormula(`=${selectedRange.getCell(0, 0).getAddress()}>${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
}
```
isPreview: false
isDeprecated: false
type: interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ remarks: |-
let selectedRange = workbook.getSelectedRange();

// Apply a rule for positive change from the previous column.
let positiveChange = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
positiveChange.getCustom().getFormat().getFill().setColor("lightgreen");
positiveChange.getCustom().getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}>${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
let positiveChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
let positiveCustom: ExcelScript.CustomConditionalFormat = positiveChange.getCustom();
positiveCustom.getFormat().getFill().setColor("lightgreen");
positiveCustom.getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}>${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);

// Apply a rule for negative change from the previous column.
let negativeChange = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
negativeChange.getCustom().getFormat().getFill().setColor("pink");
negativeChange.getCustom().getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}<${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
let negativeChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
let negativeCustom: ExcelScript.CustomConditionalFormat = negativeChange.getCustom();
negativeCustom.getFormat().getFill().setColor("pink");
negativeCustom.getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}<${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);

// Apply a rule for no change from the previous column.
let noChange = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
noChange.getCustom().getFormat().getFill().setColor("lightyellow");
noChange.getCustom().getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}=${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
let sameChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
let sameCustom: ExcelScript.CustomConditionalFormat = sameChange.getCustom();
sameCustom.getFormat().getFill().setColor("lightyellow");
sameCustom.getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}=${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
}
```
isPreview: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ methods:
fullName: getInvalidCells()
summary: >-
Returns a `RangeAreas` object, comprising one or more rectangular ranges, with invalid cell values. If all cell
values are valid, this method returns `null`<!-- -->.
values are valid, this function will return `null`<!-- -->.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ properties:
uid: 'ExcelScript!ExcelScript.PivotLabelFilter#substring:member'
package: ExcelScript!
fullName: substring
summary: 'The substring used for `beginsWith`<!-- -->, `endsWith`<!-- -->, and `contains` filter conditions.'
summary: 'The substring used for the `beginsWith`<!-- -->, `endsWith`<!-- -->, and `contains` filter conditions.'
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ methods:
summary: >-
Returns a `RangeAreas` object that represents the merged areas in this range. Note that if the merged areas count
in this range is more than 512, then this method will fail to return the result. If the `RangeAreas` object
doesn't exist, then this method returns `undefined`<!-- -->.
doesn't exist, then this function returns `undefined`<!-- -->.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ExcelScript.SortMethod
uid: 'ExcelScript!ExcelScript.SortMethod:enum'
package: ExcelScript!
fullName: ExcelScript.SortMethod
summary: ''
summary: Represents the ordering method to be used when sorting Chinese characters.
remarks: |-


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ methods:
uid: 'ExcelScript!ExcelScript.Workbook#refreshAllDataConnections:member(1)'
package: ExcelScript!
fullName: refreshAllDataConnections()
summary: Makes a request to refresh all the data connections.
summary: Refreshes all the Data Connections.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ methods:
uid: 'ExcelScript!ExcelScript.WorkbookProtection#protect:member(1)'
package: ExcelScript!
fullName: protect(password)
summary: Protects a workbook. Fails if the workbook has been protected.
summary: Protects the workbook. Fails if the workbook has been protected.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down Expand Up @@ -80,7 +80,7 @@ methods:
uid: 'ExcelScript!ExcelScript.WorkbookProtection#unprotect:member(1)'
package: ExcelScript!
fullName: unprotect(password)
summary: Unprotects a workbook.
summary: Unprotects the workbook.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ methods:
```TypeScript
/**
* This script searches through a worksheet and finds cells containing "No".
* Those cells are filled red.
* Those cells are filled with the color red.
* Use Range.find instead of Worksheet.findAll when you want to limit the search to a specific range.
*/
function main(workbook: ExcelScript.Workbook) {
Expand Down Expand Up @@ -1067,7 +1067,7 @@ methods:
uid: 'ExcelScript!ExcelScript.Worksheet#getName:member(1)'
package: ExcelScript!
fullName: getName()
summary: The display name of the worksheet.
summary: The display name of the worksheet. The name must be fewer than 32 characters.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down Expand Up @@ -1740,7 +1740,7 @@ methods:
uid: 'ExcelScript!ExcelScript.Worksheet#setName:member(1)'
package: ExcelScript!
fullName: setName(name)
summary: The display name of the worksheet.
summary: The display name of the worksheet. The name must be fewer than 32 characters.
remarks: ''
isPreview: false
isDeprecated: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,32 @@ uid: 'ExcelScript!ExcelScript.WorksheetSearchCriteria:interface'
package: ExcelScript!
fullName: ExcelScript.WorksheetSearchCriteria
summary: Represents the worksheet search criteria to be used.
remarks: ''
remarks: |-


#### Examples

```TypeScript
/**
* This script searches through a worksheet and finds cells containing "No".
* Those cells are filled with the color red.
* Use Range.find instead of Worksheet.findAll when you want to limit the search to a specific range.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the current, active worksheet.
const worksheet = workbook.getActiveWorksheet();

// Get all the cells that exactly contain the string "No".
const searchCriteria: ExcelScript.WorksheetSearchCriteria = {
completeMatch: true,
matchCase: true
};
const noCells = worksheet.findAll("No", searchCriteria);

// Set the fill color to red.
noCells.getFormat().getFill().setColor("red");
}
```
isPreview: false
isDeprecated: false
type: interface
Expand Down
65 changes: 55 additions & 10 deletions docs/sample-scripts/excel-scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,27 @@
};
presetFormat.setRule(duplicateRule);
}
'ExcelScript.ConditionalFormatRule:interface':
- |-
/**
* This script applies a custom conditional formatting to the selected range.
* A light-green fill is applied to a cell if the value is larger than the value in the row's previous column.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the selected cells.
let selectedRange = workbook.getSelectedRange();

// Apply a rule for positive change from the previous column.
let positiveChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);

// Set the conditional format to be a lightgreen fill.
let positiveCustom: ExcelScript.CustomConditionalFormat = positiveChange.getCustom();
positiveCustom.getFormat().getFill().setColor("lightgreen");

// Set the conditional rule to be if there is positive change across the row.
let positiveRule: ExcelScript.ConditionalFormatRule = positiveCustom.getRule();
positiveRule.setFormula(`=${selectedRange.getCell(0, 0).getAddress()}>${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
}
'ExcelScript.ConditionalFormatRuleType:enum':
- |-
/**
Expand Down Expand Up @@ -1640,19 +1661,22 @@
let selectedRange = workbook.getSelectedRange();

// Apply a rule for positive change from the previous column.
let positiveChange = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
positiveChange.getCustom().getFormat().getFill().setColor("lightgreen");
positiveChange.getCustom().getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}>${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
let positiveChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
let positiveCustom: ExcelScript.CustomConditionalFormat = positiveChange.getCustom();
positiveCustom.getFormat().getFill().setColor("lightgreen");
positiveCustom.getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}>${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);

// Apply a rule for negative change from the previous column.
let negativeChange = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
negativeChange.getCustom().getFormat().getFill().setColor("pink");
negativeChange.getCustom().getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}<${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
let negativeChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
let negativeCustom: ExcelScript.CustomConditionalFormat = negativeChange.getCustom();
negativeCustom.getFormat().getFill().setColor("pink");
negativeCustom.getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}<${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);

// Apply a rule for no change from the previous column.
let noChange = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
noChange.getCustom().getFormat().getFill().setColor("lightyellow");
noChange.getCustom().getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}=${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
let sameChange: ExcelScript.ConditionalFormat = selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
let sameCustom: ExcelScript.CustomConditionalFormat = sameChange.getCustom();
sameCustom.getFormat().getFill().setColor("lightyellow");
sameCustom.getRule().setFormula(`=${selectedRange.getCell(0, 0).getAddress()}=${selectedRange.getOffsetRange(0, -1).getCell(0, 0).getAddress()}`);
}
'ExcelScript.CustomDataValidation:interface':
- |-
Expand Down Expand Up @@ -6748,7 +6772,7 @@
- |-
/**
* This script searches through a worksheet and finds cells containing "No".
* Those cells are filled red.
* Those cells are filled with the color red.
* Use Range.find instead of Worksheet.findAll when you want to limit the search to a specific range.
*/
function main(workbook: ExcelScript.Workbook) {
Expand Down Expand Up @@ -7006,4 +7030,25 @@

// Apply the given protection options.
sheetProtection.protect(protectionOptions);
}
'ExcelScript.WorksheetSearchCriteria:interface':
- |-
/**
* This script searches through a worksheet and finds cells containing "No".
* Those cells are filled with the color red.
* Use Range.find instead of Worksheet.findAll when you want to limit the search to a specific range.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the current, active worksheet.
const worksheet = workbook.getActiveWorksheet();

// Get all the cells that exactly contain the string "No".
const searchCriteria: ExcelScript.WorksheetSearchCriteria = {
completeMatch: true,
matchCase: true
};
const noCells = worksheet.findAll("No", searchCriteria);

// Set the fill color to red.
noCells.getFormat().getFill().setColor("red");
}
8 changes: 4 additions & 4 deletions generate-docs/API Coverage Report.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ ExcelScript.ConditionalFormatPresetCriterion,"twoStdDevAboveAverage",EnumField,M
ExcelScript.ConditionalFormatPresetCriterion,"twoStdDevBelowAverage",EnumField,Missing,false
ExcelScript.ConditionalFormatPresetCriterion,"uniqueValues",EnumField,Missing,false
ExcelScript.ConditionalFormatPresetCriterion,"yesterday",EnumField,Missing,false
ExcelScript.ConditionalFormatRule,N/A,Class,Fine,false
ExcelScript.ConditionalFormatRule,N/A,Class,Fine,true
ExcelScript.ConditionalFormatRule,"getFormula()",Method,Poor,false
ExcelScript.ConditionalFormatRule,"getFormulaLocal()",Method,Poor,false
ExcelScript.ConditionalFormatRule,"setFormula(formula)",Method,Poor,false
Expand Down Expand Up @@ -2925,7 +2925,7 @@ ExcelScript.SortField,"icon",Property,Fine,false
ExcelScript.SortField,"key",Property,Good,true
ExcelScript.SortField,"sortOn",Property,Fine,false
ExcelScript.SortField,"subField",Property,Fine,false
ExcelScript.SortMethod,N/A,Enum,Missing,true
ExcelScript.SortMethod,N/A,Enum,Fine,true
ExcelScript.SortMethod,"pinYin",EnumField,Missing,false
ExcelScript.SortMethod,"strokeCount",EnumField,Missing,false
ExcelScript.SortOn,N/A,Enum,Fine,true
Expand Down Expand Up @@ -3246,7 +3246,7 @@ ExcelScript.Worksheet,"getEnableCalculation()",Method,Poor,false
ExcelScript.Worksheet,"getFreezePanes()",Method,Poor,false
ExcelScript.Worksheet,"getHorizontalPageBreaks()",Method,Poor,false
ExcelScript.Worksheet,"getId()",Method,Poor,false
ExcelScript.Worksheet,"getName()",Method,Poor,true
ExcelScript.Worksheet,"getName()",Method,Fine,true
ExcelScript.Worksheet,"getNamedItem(name)",Method,Poor,false
ExcelScript.Worksheet,"getNamedSheetView(key)",Method,Poor,false
ExcelScript.Worksheet,"getNamedSheetViews()",Method,Poor,false
Expand Down Expand Up @@ -3340,6 +3340,6 @@ ExcelScript.WorksheetProtectionOptions,"allowInsertRows",Property,Fine,false
ExcelScript.WorksheetProtectionOptions,"allowPivotTables",Property,Fine,false
ExcelScript.WorksheetProtectionOptions,"allowSort",Property,Fine,false
ExcelScript.WorksheetProtectionOptions,"selectionMode",Property,Fine,false
ExcelScript.WorksheetSearchCriteria,N/A,Class,Fine,false
ExcelScript.WorksheetSearchCriteria,N/A,Class,Fine,true
ExcelScript.WorksheetSearchCriteria,"completeMatch",Property,Good,false
ExcelScript.WorksheetSearchCriteria,"matchCase",Property,Good,false
Loading