Excel.EntityCellValue interface
スキーマや定義済みの構造体を持たないプロパティのセットを表します。
注釈
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/20-data-types/data-types-function-references.yaml
// Attach a reference to a JavaScript custom function as a method on a math entity.
await Excel.run(async (context) => {
const sheet: Excel.Worksheet = context.workbook.worksheets.getItem("Sample");
const entityRange: Excel.Range = sheet.getRange("A2");
const referenceType: Excel.FunctionCellValueType = Excel.FunctionCellValueType.javaScriptReference;
const customFunctionReference: Excel.JavaScriptCustomFunctionReferenceCellValue = {
type: Excel.CellValueType.function,
functionType: referenceType,
namespace: "CONTOSO",
id: "GET27"
};
// The namespace and ID identify a function; this value doesn't register its implementation.
const mathEntity: Excel.EntityCellValue = {
type: Excel.CellValueType.entity,
text: "Math value",
properties: {
Value: {
type: Excel.CellValueType.double,
basicValue: 10
},
Get27: customFunctionReference
}
};
entityRange.valuesAsJson = [[mathEntity]];
entityRange.format.autofitColumns();
await context.sync();
console.log("Created the Math value entity in Sample!A2. Read the reference to inspect its metadata.");
});
プロパティ
| basic |
この値を持つセルに対して |
| basic |
この値を持つセルに対して |
| layouts | このエンティティのビューのレイアウト情報を表します。 |
| properties | このエンティティとそのメタデータのプロパティを表します。 |
| provider | この |
| referenced |
|
| text | この値を持つセルがレンダリングされるときに表示されるテキストを表します。 |
| type | このセル値の型を表します。 |
プロパティの詳細
basicType
この値を持つセルに対して Range.valueTypes によって返される値を表します。
basicType?: RangeValueType.error | "Error";
プロパティ値
error | "Error"
注釈
basicValue
この値を持つセルに対して Range.values によって返される値を表します。
valuesAsJson プロパティを使用してアクセスする場合、この文字列値は en-US ロケールに合わせて調整されます。
valuesAsJsonLocal プロパティを使用してアクセスする場合、この文字列値はユーザーの表示ロケールに合わせて配置されます。
basicValue?: "#VALUE!" | string;
プロパティ値
"#VALUE!" | string
注釈
layouts
このエンティティのビューのレイアウト情報を表します。
layouts?: EntityViewLayouts;
プロパティ値
注釈
properties
このエンティティとそのメタデータのプロパティを表します。
properties?: {
[key: string]: EntityPropertyType;
};
プロパティ値
{ [key: string]: Excel.EntityPropertyType; }
注釈
provider
この EntityCellValueのデータを提供したサービスを説明する情報を表します。 この情報は、エンティティ カードのブランド化に使用できます。
provider?: CellValueProviderAttributes;
プロパティ値
注釈
referencedValues
EntityCellValue.properties
内で参照されるセル値を表します。
referencedValues?: ReferencedValue[];
プロパティ値
注釈
text
type
このセル値の型を表します。
type: CellValueType.entity | ReferenceValueType.entity | "Entity";