This and that...

This and that...

Secure Microsoft Excel spreadsheets with LotusScript

Notes ProgramingPosted by Martin Tue, February 17, 2009 18:26:14

Want to protect Microsoft Excel spreadsheets from tampering? This LotusScript code only allows users to edit columns that you specify as permitted. Other columns can be locked programmatically, and the Microsoft Excel file will be protected with a password. The only way for the secured columns to be edited is for the user to know the password and edit them after entering it.

'Setting the Excel object.

Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWorkbook =
Set ExcelWorksheet =
' You can enter the values and once
the entry is over lock the columns.
With ExcelWorksheet
' .Range("A1:B1").Select
.Range("A1").Value ="Prasad"
.Range("B1").Value ="Lekshmi"
End With
ExcelWorksheet.Protect Password="1234"
' You just need one line to protect excel sheet from tampering.
Set ExcelApp=Nothing

Fill in only if you are not real

The following XHTML tags are allowed: <b>, <br/>, <em>, <i>, <strong>, <u>. CSS styles and Javascript are not permitted.