Skip to content

Instantly share code, notes, and snippets.

View akrantz's full-sized avatar

Adam Krantz akrantz

View GitHub Profile
@akrantz
akrantz / Data types: Formatted numbers.EXCEL.yaml
Created July 26, 2023 21:47
This sample shows how to set and get data types using the formatted number properties.
name: 'Data types: Formatted numbers'
description: >-
This sample shows how to set and get data types using the formatted number
properties.
host: EXCEL
api_set: {}
script:
content: >-
$("#setup").click(() => tryCatch(setup));
@akrantz
akrantz / Work with tags.POWERPOINT.yaml
Last active August 10, 2023 23:00
Use tags to process subsets of slides.
name: Work with tags
description: Use tags to process subsets of slides.
host: POWERPOINT
api_set: {}
script:
content: >
$("#add-selected-slide-tag").click(() => tryCatch(addTagToSelectedSlide));
$("#delete-slides-by-audience").click(() =>
tryCatch(deleteSlidesByAudience));
@akrantz
akrantz / Add binding for selected range.EXCEL.yaml
Last active July 21, 2023 17:35
Adds a new binding for the selected range.
name: Add binding for selected range
description: Adds a new binding for the selected range.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@akrantz
akrantz / Custom Function returns a Promise.EXCEL.yaml
Last active July 19, 2019 20:33
A custom function which returns a Promise
name: Custom Function returns a Promise
description: A custom function which returns a Promise
host: EXCEL
api_set: {}
script:
content: |
/**
* Async custom function
* @customfunction
*/
@akrantz
akrantz / Custom Function SUM().EXCEL.yaml
Last active April 25, 2022 08:02
Implement the SUM() function in JavaScript.
name: Custom Function SUM()
description: Implement the SUM() function in JavaScript.
host: EXCEL
api_set: {}
script:
content: |
/**
* The sum of all of the numbers.
* @customfunction
* @param number1 A number (such as 1 or 3.1415), a cell address (such as A1 or $E$11), or a range of cell addresses (such as B3:F12).
@akrantz
akrantz / Repeating parameters.EXCEL.yaml
Created May 30, 2019 01:33
Sample functions that use repeating parameters.
name: Repeating parameters
description: Sample functions that use repeating parameters.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@akrantz
akrantz / underscore.EXCEL.yaml
Created May 24, 2019 18:29
Can custom function id contain an underscore?
name: underscore
description: Can custom function id contain an underscore?
host: EXCEL
api_set: {}
script:
content: |-
/**
* @customfunction
*/
function add_numbers(first: number, second: number): number {
@akrantz
akrantz / Streaming function that returns a 2D array of numbers.EXCEL.yaml
Created May 20, 2019 21:50
A streaming function that continuously pushes incremental values into an array.
name: Streaming function that returns a 2D array of numbers
description: >-
A streaming function that continuously pushes incremental values into an
array.
host: EXCEL
api_set: {}
script:
content: >-
/**
* Increments a value once a second.
@akrantz
akrantz / test.html
Created May 2, 2019 04:35
Hello World HTML
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@akrantz
akrantz / test.md
Created May 2, 2019 04:35
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}