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
allow |
Especifica se algum dos |
is |
Obtém o status de proteção atual da planilha. |
protection |
Especifica se o |
sheet |
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 |
worksheet |
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
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
sheetPasswordChanged
Especifica se a senha da planilha foi alterada.
sheetPasswordChanged: boolean;
Valor da propriedade
boolean
Comentários
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
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 + ".");
});
}
Comentários
https://aka.ms/ContentUserFeedback.
Em breve: Ao longo de 2024, eliminaremos os problemas do GitHub como o mecanismo de comentários para conteúdo e o substituiremos por um novo sistema de comentários. Para obter mais informações, consulteEnviar e exibir comentários de