Proteggere e Difendere il Foglio di Lavoro

Proteggere e proteggere il foglio di lavoro in MS Excel

proteggere e proteggere il foglio di lavoro

  1. Fare clic su Revisione > Proteggi foglio di lavoro.
  2. Inserire una password nella casella di Password.
  3. Selezionare le opzioni consenti.
  4. Selezionare OK, reinserire la password per confermarla e quindi selezionare di nuovo OK.

Proteggere il foglio di lavoro utilizzando Aspose.Cell per .Net

È sufficiente utilizzare le seguenti linee di codice per implementare la protezione della struttura della cartella di lavoro dei file di Excel.

//Create a new file.
Workbook workbook = new Workbook();
//Gets the first worksheet.
Worksheet sheet = workbook.Worksheets[0];
//Protect contents of the worksheet.
sheet.Protect(ProtectionType.Contents);
//Protect worksheet with password.
sheet.Protection.Password = "test";
//Save as Excel file.
workbook.Save("Book1.xlsx");

Sbloccare il foglio di lavoro utilizzando Aspose.Cell per .Net

Sbloccare un foglio di lavoro è facile con l’API Aspose.Cells. Se il foglio di lavoro è protetto da password, è necessaria una password corretta.

//Create a new file.
Workbook workbook = new Workbook("Book1.xlsx");
//Gets the first worksheet.
Worksheet sheet = workbook.Worksheets[0];
//Protect contents of the worksheet.
sheet.Unprotect("password");
//Save Excel file.
workbook.Save("Book1.xlsx");

Argomenti avanzati