Is there a way to lock an Excel workbook in such a way that you cannot select any cells and/or change any of the workbook’s information? Basically when my program is in export mode, I don’t want the user to be able to change data or select any cells.
Share
Maybe this way : Locking worksheets
Code snippet given by the MSDN :
You should be able to do the same without using the Globals.Sheet1, because the MSDN assumes you have such a sheet. Doing it programatically should be possible.
Edit : Locking the Workbook itself, but you seem to want to lock both the WorkBook and the worksheet :
Workbook locking
The password is optionnal :
here is another link Common tasks in Excel