Protect an excel sheet with usernsme and password. In this way, when you try to open the excel, it will request you the username and the password.
1 excel.Workbook.writeProtectedWorkbook
<excel.Workbook.writeProtectedWorkbook>
<wb /> +
<user /> +
<pass /> +
</excel.Workbook.writeProtectedWorkbook>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ewb | Workbook | Worksheet to which you want to add a password. | |||
Euser | String | Username. | |||
Epass | String | Password. |
Example
Protect an excel with user and password.
Copy
<xsql-script name='sample_excel_Workbook_writeProtectedWorkbook'> <body> <set name="sheet_1"> <excel.Workbook.createSheet name="Sheet 1"> <wb/> </excel.Workbook.createSheet> </set> <set name="cell_r2c5"> <excel.Sheet.createCell row="5" col="5"> <sheet_1/> </excel.Sheet.createCell> </set> <excel.Cell.setCellValue> <cell_r2c5/> <string>ZOOM OF 250%</string> </excel.Cell.setCellValue> <excel.Workbook.writeProtectedWorkbook> <wb /> <string>manuel</string> <string>manuel321</string> </Workbook.writeProtectedWorkbook> <excel.Workbook.write> <wb/> <file name="test.xls" type="absolute"/> </excel.Workbook.write> </body> </xsql-script>