1Jan

Excel For Mac Json

Excel For Mac Json Rating: 5,5/10 6650 reviews
-->

When an Excel custom function is written in JavaScript or TypeScript, JSDoc tags are used to provide extra information about the custom function. The JSDoc tags are then used at build time to create the JSON metadata file. Using JSDoc tags saves you from the effort of manually editing the JSON metadata file.

Json/xml to excel/CSV/html online converter and viewer. Convert your JSON/XML file to CSV/ XLS/XLSX (Excel spreadsheet format)/HTML and view workbook directly in a Web browser. Convert JSON (View data in Excel Workbook) Convert XML.

Important

Note that Excel custom functions are available on the following platforms.

  • Office on Windows (version 1904 or later, connected to Office 365 subscription)
  • Office on Mac (version 16.24 or later, connected to Office 365 subscription)
  • Office on the web

Excel custom functions are currently not supported on iPad or in one-time purchase versions of Office 2019 or earlier.

Add the @customfunction tag in the code comments for a JavaScript or TypeScript function to mark it as a custom function.

The function parameter types may be provided using the @param tag in JavaScript, or from the Function type in TypeScript. For more information, see the @param tag and Types sections.

Adding a description to a function

The description is displayed to the user as help text when they need help to understand what your custom function does. The description doesn't require any specific tag. Just enter a short text description in the JSDoc comment. In general the description is placed at the start of the JSDoc comment section, but it will work no matter where it is placed.

Welcome to the new Unreal Engine 4 Documentation site! We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime. Unreal Engine is the world’s most open and advanced real-time 3D creation platform for photoreal visuals and immersive experiences. Unreal Engine is the world’s most open and advanced real-time 3D creation platform for photoreal visuals and immersive experiences. Download Features. Unreal Engine is the world’s most open and advanced real-time 3D creation platform. Continuously evolving to serve not only its original purpose as a state-of-the-art games engine, today it gives creators across industries the freedom and control to deliver cutting-edge content, interactive experiences, and immersive virtual worlds. Unreal Engine 4 for Mac is a complete suite of game development tools made by game developers, for game developers. From 2D mobile games to console blockbusters and VR, Unreal Engine 4 for Mac gives you everything you need to start, ship, grow and stand out from the crowd. Unreal engine download sdk for mac.

To see examples of the built-in function descriptions, open Excel, go to the Formulas tab, and choose Insert function. You can then browse through all the function descriptions, and also see your own custom functions listed.

In the following example, the phrase 'Calculates the volume of a sphere.' is the description for the custom function.

JSDoc Tags

The following JSDoc tags are supported in Excel custom functions:

  • @customfunction id name
  • @helpurl url
  • @param{type} name description
  • @returns{type}

@cancelable

Indicates that a custom function wants to perform an action when the function is canceled.

The last function parameter must be of type CustomFunctions.CancelableInvocation. The function can assign a function to the oncanceled property to denote the action to perform when the function is canceled.

If the last function parameter is of type CustomFunctions.CancelableInvocation, it will be considered @cancelable even if the tag isn't present.

A function can't have both @cancelable and @streaming tags.

@customfunction

Syntax: @customfunction idname

Specify this tag to treat the JavaScript/TypeScript function as an Excel custom function.

This tag is required to create metadata for the custom function.

The following example shows the simplest way to declare a custom function.

id

The id is an invariant identifier for the custom function.

  • If id isn't provided, the JavaScript/TypeScript function name is converted to uppercase and disallowed characters are removed.
  • The id must be unique for all custom functions.
  • The allowed characters are limited to: A-Z, a-z, 0-9, underscores (_), and period (.).

In the following example, increment is the id and the name of the function.

name

Provides the display name for the custom function.

  • If name isn't provided, the id is also used as the name.
  • Allowed characters: Letters Unicode Alphabetic character, numbers, period (.), and underscore (_).
  • Must start with a letter.
  • Maximum length is 128 characters.

In the following example, INC is the id of the function and increment is the name.

description

A description doesn't require any specific tag. Add a description to a custom function by adding a phrase to describe what the function does inside the JSDoc comment. By default, whatever text is untagged in the JSDoc comment section will be the description of the function. The description appears to users in Excel as they are entering the function. In the following example, the phrase 'A function that adds two numbers' is the description for the custom function with the id property of ADD.

In the following example, ADD is the id and name of the function and a description is given.

@helpurl

Syntax: @helpurl url

The provided url is displayed in Excel.

In the following example, the helpurl is www.contoso.com/weatherhelp.

@param

JavaScript

JavaScript Syntax: @param {type} name description

  • {type} should specify the type info within curly braces. See the Types section for more information about the types which may be used. Optional: if not specified, the type any will be used.
  • name specifies which parameter the @param tag applies to. Required.
  • description provides the description which appears in Excel for the function parameter. Optional.

To denote a custom function parameter as optional:

  • Put square brackets around the parameter name. For example: @param {string} [text] Optional text.

Note

The default value for optional parameters is null.

The following example shows a ADD function which adds two or three numbers, with the third number as an optional parameter.

TypeScript

TypeScript Syntax: @param name description

  • name specifies which parameter the @param tag applies to. Required.
  • description provides the description which appears in Excel for the function parameter. Optional.

See the Types section for more information about the function parameter types which may be used.

To denote a custom function parameter as optional, do one of the following:

  • Use an optional parameter. For example: function f(text?: string)
  • Give the parameter a default value. For example: function f(text: string = 'abc')

For detailed description of the @param see: JSDoc

Note

The default value for optional parameters is null.

The following example shows the add function that adds two numbers.

@requiresAddress

Indicates that the address of the cell where the function is being evaluated should be provided.

The last function parameter must be of type CustomFunctions.Invocation or a derived type. When the function is called, the address property will contain the address. For an example of a function that uses the @requiresAddress tag, see Addressing cell's context parameter.

@returns

Syntax: @returns {type}

Provides the type for the return value.

If {type} is omitted, the TypeScript type info will be used. If there is no type info, the type will be any.

The following example shows the add function that uses the @returns tag.

@streaming

Used to indicate that a custom function is a streaming function.

For

The last parameter should be of type CustomFunctions.StreamingInvocation<ResultType>.The function should return void.

Streaming functions don't return values directly, but rather should call setResult(result: ResultType) using the last parameter.

Exceptions thrown by a streaming function are ignored. setResult() may be called with Error to indicate an error result. For an example of a streaming function and more information, see Make a streaming function.

Streaming functions can't be marked as @volatile.

@volatile

A volatile function is one whose result isn't the same from one moment to the next, even if it takes no arguments or the arguments haven't changed. Excel re-evaluates cells that contain volatile functions, together with all dependents, every time that a calculation is done. For this reason, too much reliance on volatile functions can make recalculation times slow, so use them sparingly.

Streaming functions can't be volatile.

The following function is volatile and uses the @volatile tag.

Types

By specifying a parameter type, Excel will convert values into that type before calling the function. If the type is any, no conversion will be performed.

Value types

A single value may be represented using one of the following types: boolean, number, string.

Matrix type

Use a two-dimensional array type to have the parameter or return value be a matrix of values. For example, the type number[][] indicates a matrix of numbers. string[][] indicates a matrix of strings.

Error type

A non-streaming function can indicate an error by returning an Error type.

A streaming function can indicate an error by calling setResult() with an Error type.

Promise

A function can return a Promise, which will provide the value when the promise is resolved. If the promise is rejected, then it is an error.

Other types

Any other type will be treated as an error.

Next steps

Learn about naming conventions for custom functions. Alternatively, learn how to localize your functions which requires you to write your JSON file by hand.

See also