ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   locking excel sheet from vb code (https://www.excelbanter.com/excel-programming/376628-locking-excel-sheet-vbulletin-code.html)

Suresh[_5_]

locking excel sheet from vb code
 
hi,


i am creating an excel sheet from vb and importing some data in to it.
i want to lock that excel sheet so that the data in the excel sheet is
not changed.

pls help me.

Thanks in advance.

Suresh


Stefi

locking excel sheet from vb code
 
The best way is to record a macro of Tools/Protection/Protect Sheet action!
You will then see in the recorded macro something like this:

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Regards,
Stefi

"Suresh" wrote:

hi,


i am creating an excel sheet from vb and importing some data in to it.
i want to lock that excel sheet so that the data in the excel sheet is
not changed.

pls help me.

Thanks in advance.

Suresh




All times are GMT +1. The time now is 10:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com