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.

Eigenschaften

allowEditRangesChanged

Gibt an, ob sich eines der AllowEditRange Objekte geändert hat.

isProtected

Ruft den aktuellen Status des Arbeitsblatts ab.

protectionOptionsChanged

Gibt an, ob sie WorksheetProtectionOptions sich geändert haben.

sheetPasswordChanged

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 Excel.EventType .

worksheetId

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

API-Satz: ExcelApiOnline 1.1

isProtected

Ruft den aktuellen Status des Arbeitsblatts ab.

isProtected: boolean;

Eigenschaftswert

boolean

Hinweise

API-Satz: ExcelApi 1.14

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

API-Satz: ExcelApiOnline 1.1

sheetPasswordChanged

Gibt an, ob sich das Arbeitsblattkennwort geändert hat.

sheetPasswordChanged: boolean;

Eigenschaftswert

boolean

Hinweise

API-Satz: ExcelApiOnline 1.1

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

API-Satz: ExcelApi 1.14

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

API-Satz: ExcelApi 1.14

worksheetId

Ruft die ID des Arbeitsblatts ab, in dem der Status des Schutzes geändert wird.

worksheetId: string;

Eigenschaftswert

string

Hinweise

API-Satz: ExcelApi 1.14

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 + ".");
    });
}