Skip to content

Instantly share code, notes, and snippets.

View lumine2008's full-sized avatar

Raymond lumine2008

  • Microsoft
  • Beijing
View GitHub Profile
@lumine2008
lumine2008 / Issue with document settings.EXCEL.yaml
Created January 15, 2021 01:57
Issue with document settings
name: Issue with document settings
description: Issue with document settings
host: EXCEL
api_set: {}
script:
content: |
$("#save").click(() => tryCatch(save));
$("#read").click(() => tryCatch(read));
async function save() {
@lumine2008
lumine2008 / Create and delete geometric shapes.EXCEL.yaml
Created January 13, 2021 09:08
Creates a few different geometric shapes and deletes them from the worksheet.
name: Create and delete geometric shapes
description: Creates a few different geometric shapes and deletes them from the worksheet.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#createHexagon").click(() => tryCatch(createHexagon));
$("#removeAll").click(() => tryCatch(removeAll));
@lumine2008
lumine2008 / Image shapes.EXCEL.yaml
Created January 13, 2021 01:26
Creates and adjusts image-based shapes.
name: Image shapes
description: Creates and adjusts image-based shapes.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#selectedFile").change(() => tryCatch(readImageFromFile));
$("#flipImage").click(() => tryCatch(flipImage));
$("#getImageFormat").click(() => tryCatch(getImageFormat));
@lumine2008
lumine2008 / onFormulaChanged Event .EXCEL.yaml
Created January 5, 2021 08:18
Performs a basic Excel API call using TypeScript.
name: 'onFormulaChanged Event '
description: Performs a basic Excel API call using TypeScript.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@lumine2008
lumine2008 / Distinguish user event by gobal flag.EXCEL.yaml
Last active November 25, 2020 05:49
Registers event handlers that run when data is changed in worksheet, the selected range changes in a worksheet, or the worksheet is recalculated.
name: Distinguish user event by gobal flag
description: >-
Registers event handlers that run when data is changed in worksheet, the
selected range changes in a worksheet, or the worksheet is recalculated.
host: EXCEL
api_set: {}
script:
content: >
$("#setup").click(() => tryCatch(setup));
@lumine2008
lumine2008 / Distinguish user event by recorded address.EXCEL.yaml
Last active November 24, 2020 09:32
Registers event handlers that run when data is changed in worksheet, the selected range changes in a worksheet, or the worksheet is recalculated.
name: Distinguish user event by recorded address
description: >-
Registers event handlers that run when data is changed in worksheet, the
selected range changes in a worksheet, or the worksheet is recalculated.
host: EXCEL
api_set: {}
script:
content: >
$("#setup").click(() => tryCatch(setup));
name: TableFormat to None
description: Formats a table.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#format-table").click(() => tryCatch(formatTable));
async function formatTable() {
@lumine2008
lumine2008 / Create geometric shapes.EXCEL.yaml
Created September 3, 2020 15:13
Creates a few different geometric shapes and deletes them from the worksheet.
name: Create geometric shapes
description: Creates a few different geometric shapes and deletes them from the worksheet.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#createHexagon").click(() => tryCatch(createHexagon));
$("#createTriangle").click(() => tryCatch(createTriangle));
$("#createSmileyFace").click(() => tryCatch(createSmileyFace));
@lumine2008
lumine2008 / Workbook and worksheet collection events.EXCEL.yaml
Created September 3, 2020 14:56
Registers event handlers that run when a worksheet is added, activated, or deactivated, or when the settings of a workbook are changed.
name: Workbook and worksheet collection events
description: >-
Registers event handlers that run when a worksheet is added, activated, or
deactivated, or when the settings of a workbook are changed.
host: EXCEL
api_set: {}
script:
content: >
$("#register-on-add-handler").click(() => tryCatch(registerOnAddHandler));
name: Test Interaction TableCollection.add and Workbook.onSelectionChanged
description: ''
host: EXCEL
api_set: {}
script:
content: |
$("#addHandler").click(() => tryCatch(addHandler));
$("#setRangeValues").click(() => tryCatch(setRangeValues));
$("#addTable").click(() => tryCatch(addTable));
$("#selectRange").click(() => tryCatch(selectRange));