Excel.WorksheetProtectionChangedEventArgs interface
Stellt Informationen zu dem Arbeitsblatt bereit, das das Ereignis "Schutzstatusänderung" ausgelöst hat, das ausgelöst wird, wenn der Schutzstatus in einem Arbeitsblatt aktualisiert wird.
Hinweise
Eigenschaften
allow |
Gibt an, ob eines der |
is |
Ruft den aktuellen Schutzstatus des Arbeitsblatts ab. |
protection |
Gibt an, ob geändert |
sheet |
Gibt an, ob das Arbeitsblattkennwort geändert wurde. |
source | Die Quelle des Ereignisses. Dies kann lokal oder remote sein (durch gemeinsame Dokumenterstellung). |
type | Ruft den Typ des Ereignisses ab. Weitere Informationen finden Sie unter |
worksheet |
Ruft die ID des Arbeitsblatts ab, in dem der Schutzstatus geändert wird. |
Details zur Eigenschaft
allowEditRangesChanged
Gibt an, ob eines der AllowEditRange
Objekte geändert wurde.
allowEditRangesChanged: boolean;
Eigenschaftswert
boolean
Hinweise
isProtected
Ruft den aktuellen Schutzstatus 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 geändert WorksheetProtectionOptions
wurde.
protectionOptionsChanged: boolean;
Eigenschaftswert
boolean
Hinweise
sheetPasswordChanged
Gibt an, ob das Arbeitsblattkennwort geändert wurde.
sheetPasswordChanged: boolean;
Eigenschaftswert
boolean
Hinweise
source
Die Quelle des Ereignisses. Dies kann lokal oder remote sein (durch gemeinsame Dokumenterstellung).
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 finden Sie unter Excel.EventType
.
type: "WorksheetProtectionChanged";
Eigenschaftswert
"WorksheetProtectionChanged"
Hinweise
worksheetId
Ruft die ID des Arbeitsblatts ab, in dem der Schutzstatus 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 + ".");
});
}
Office Add-ins