Share via


Excel.WorksheetProtectionChangedEventArgs interface

Fornece informações sobre a planilha que levantou o evento alterado de status de proteção, que é disparado quando o status de proteção é atualizado em uma planilha.

Comentários

[ Conjunto de API: ExcelApi 1.14 ]

Propriedades

allowEditRangesChanged

Especifica se algum dos AllowEditRange objetos foi alterado.

isProtected

Obtém o status de proteção atual da planilha.

protectionOptionsChanged

Especifica se o WorksheetProtectionOptions foi alterado.

sheetPasswordChanged

Especifica se a senha da planilha foi alterada.

source

A origem do evento. Ele pode ser local ou remoto (por meio da coautoria).

type

Obtém o tipo do evento. Confira Excel.EventType detalhes.

worksheetId

Obtém a ID da planilha na qual o status de proteção é alterado.

Detalhes da propriedade

allowEditRangesChanged

Especifica se algum dos AllowEditRange objetos foi alterado.

allowEditRangesChanged: boolean;

Valor da propriedade

boolean

Comentários

[ Conjunto de API: ExcelApiOnline 1.1 ]

isProtected

Obtém o status de proteção atual da planilha.

isProtected: boolean;

Valor da propriedade

boolean

Comentários

[ Conjunto de API: ExcelApi 1.14 ]

Exemplos

// 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

Especifica se o WorksheetProtectionOptions foi alterado.

protectionOptionsChanged: boolean;

Valor da propriedade

boolean

Comentários

[ Conjunto de API: ExcelApiOnline 1.1 ]

sheetPasswordChanged

Especifica se a senha da planilha foi alterada.

sheetPasswordChanged: boolean;

Valor da propriedade

boolean

Comentários

[ Conjunto de API: ExcelApiOnline 1.1 ]

source

A origem do evento. Ele pode ser local ou remoto (por meio da coautoria).

source: Excel.EventSource | "Local" | "Remote";

Valor da propriedade

Excel.EventSource | "Local" | "Remote"

Comentários

[ Conjunto de API: ExcelApi 1.14 ]

Exemplos

// 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

Obtém o tipo do evento. Confira Excel.EventType detalhes.

type: "WorksheetProtectionChanged";

Valor da propriedade

"WorksheetProtectionChanged"

Comentários

[ Conjunto de API: ExcelApi 1.14 ]

worksheetId

Obtém a ID da planilha na qual o status de proteção é alterado.

worksheetId: string;

Valor da propriedade

string

Comentários

[ Conjunto de API: ExcelApi 1.14 ]

Exemplos

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