Excel.WorksheetProtectionChangedEventArgs interface
Enthält Informationen über das Arbeitsblatt, das den Schutz status geänderten Ereignis ausgelöst hat, das ausgelöst wird, wenn die Schutz status in einem Arbeitsblatt aktualisiert wird.
Hinweise
Verwendet von
Eigenschaften
| allow |
Gibt an, ob sich eines der |
| is |
Ruft den aktuellen Status des Arbeitsblatts ab. |
| protection |
Gibt an, ob sie |
| sheet |
Gibt an, ob sich das Arbeitsblattkennwort geändert hat. |
| source | Die Quelle des Ereignisses. Dies kann lokal oder remote (durch gemeinsame Dokumenterstellung) erfolgen. |
| type | Ruft den Typ des Ereignisses ab. Weitere Informationen findest du hier |
| worksheet |
Ruft die ID des Arbeitsblatts ab, in dem der Status des Schutzes geändert wird. |
Details zur Eigenschaft
allowEditRangesChanged
Gibt an, ob sich eines der AllowEditRange Objekte geändert hat.
allowEditRangesChanged: boolean;
Eigenschaftswert
boolean
Hinweise
isProtected
Ruft den aktuellen Status des Arbeitsblatts ab.
isProtected: boolean;
Eigenschaftswert
boolean
Hinweise
Beispiele
// 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 + ".");
});
}
protectionOptionsChanged
Gibt an, ob sie WorksheetProtectionOptions sich geändert haben.
protectionOptionsChanged: boolean;
Eigenschaftswert
boolean
Hinweise
sheetPasswordChanged
Gibt an, ob sich das Arbeitsblattkennwort geändert hat.
sheetPasswordChanged: boolean;
Eigenschaftswert
boolean
Hinweise
source
Die Quelle des Ereignisses. Dies kann lokal oder remote (durch gemeinsame Dokumenterstellung) erfolgen.
source: Excel.EventSource | "Local" | "Remote";
Eigenschaftswert
Excel.EventSource | "Local" | "Remote"
Hinweise
Beispiele
// 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 + ".");
});
}
type
Ruft den Typ des Ereignisses ab. Weitere Informationen findest du hier Excel.EventType .
type: "WorksheetProtectionChanged";
Eigenschaftswert
"WorksheetProtectionChanged"
Hinweise
worksheetId
Ruft die ID des Arbeitsblatts ab, in dem der Status des Schutzes geändert wird.
worksheetId: string;
Eigenschaftswert
string
Hinweise
Beispiele
// 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 + ".");
});
}