-
Notifications
You must be signed in to change notification settings - Fork 61
/
excel.worksheetprotectionchangedeventargs.yml
139 lines (115 loc) · 5.27 KB
/
excel.worksheetprotectionchangedeventargs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
### YamlMime:TSType
name: Excel.WorksheetProtectionChangedEventArgs
uid: 'excel!Excel.WorksheetProtectionChangedEventArgs:interface'
package: excel!
fullName: Excel.WorksheetProtectionChangedEventArgs
summary: >-
Provides information about the worksheet that raised the protection status changed event, which fires when the
protection status is updated in a worksheet.
remarks: '\[ [API set: ExcelApi 1.14](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: interface
properties:
- name: isProtected
uid: 'excel!Excel.WorksheetProtectionChangedEventArgs#isProtected:member'
package: excel!
fullName: isProtected
summary: Gets the current protection status of the worksheet.
remarks: >-
\[ [API set: ExcelApi 1.14](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/30-events/events-worksheet-protection.yaml
async function checkProtection(event: Excel.WorksheetProtectionChangedEventArgs) {
// This function is an event handler that returns the protection status of a worksheet
// and information about the changed worksheet.
await Excel.run(async (context) => {
const protectionStatus = event.isProtected;
const worksheetId = event.worksheetId;
const source = event.source;
console.log("Protection status changed. Protection status is now: " + protectionStatus + ".");
console.log(" ID of changed worksheet: " + worksheetId + ".");
console.log(" Source of change event: " + source + ".");
});
}
```
isPreview: false
isDeprecated: false
syntax:
content: 'isProtected: boolean;'
return:
type: boolean
- name: source
uid: 'excel!Excel.WorksheetProtectionChangedEventArgs#source:member'
package: excel!
fullName: source
summary: The source of the event. It can be local or remote (through co-authoring).
remarks: >-
\[ [API set: ExcelApi 1.14](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/30-events/events-worksheet-protection.yaml
async function checkProtection(event: Excel.WorksheetProtectionChangedEventArgs) {
// This function is an event handler that returns the protection status of a worksheet
// and information about the changed worksheet.
await Excel.run(async (context) => {
const protectionStatus = event.isProtected;
const worksheetId = event.worksheetId;
const source = event.source;
console.log("Protection status changed. Protection status is now: " + protectionStatus + ".");
console.log(" ID of changed worksheet: " + worksheetId + ".");
console.log(" Source of change event: " + source + ".");
});
}
```
isPreview: false
isDeprecated: false
syntax:
content: 'source: Excel.EventSource | "Local" | "Remote";'
return:
type: '<xref uid="excel!Excel.EventSource:enum" /> | "Local" | "Remote"'
- name: type
uid: 'excel!Excel.WorksheetProtectionChangedEventArgs#type:member'
package: excel!
fullName: type
summary: Gets the type of the event. See `Excel.EventType` for details.
remarks: '\[ [API set: ExcelApi 1.14](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'type: "WorksheetProtectionChanged";'
return:
type: '"WorksheetProtectionChanged"'
- name: worksheetId
uid: 'excel!Excel.WorksheetProtectionChangedEventArgs#worksheetId:member'
package: excel!
fullName: worksheetId
summary: Gets the ID of the worksheet in which the protection status is changed.
remarks: >-
\[ [API set: ExcelApi 1.14](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/30-events/events-worksheet-protection.yaml
async function checkProtection(event: Excel.WorksheetProtectionChangedEventArgs) {
// This function is an event handler that returns the protection status of a worksheet
// and information about the changed worksheet.
await Excel.run(async (context) => {
const protectionStatus = event.isProtected;
const worksheetId = event.worksheetId;
const source = event.source;
console.log("Protection status changed. Protection status is now: " + protectionStatus + ".");
console.log(" ID of changed worksheet: " + worksheetId + ".");
console.log(" Source of change event: " + source + ".");
});
}
```
isPreview: false
isDeprecated: false
syntax:
content: 'worksheetId: string;'
return:
type: string