Use the ADD and SET command before the WRITE command to format cells and columns.
The ADD command is used to add features to an Excel document.
The SET command is used to change the current features of an Excel document.
You will usually need to use a number of ADD and SET commands.
The SET command has PROTECT and PASSWORD parameters which enable the worksheet to be protected.
How to format and protect a worksheet.