Setting a workbooks protection/read only/locked

  • Thread starter Thread starter Jason Kontkanen
  • Start date Start date
J

Jason Kontkanen

Hello,

I've read various pages about locking ranges, protection, etc, but none of
it seems to work across the board. From VB, I'm opening a workbook, and the
entire thing should be locked. The user should be able to scroll and see
everything, but they shouldn't be able to edit anything. I specify read
only when I open it, and i call .Protect for the workbook, and as a test I
do .Protect DrawingObjects:=True, Contents:=True, Scenarios:=True,
UserInterfaceOnly:=True to protect the only sheet in the workbook. What
ends up happening is part of the worksheet is protected, but not the entire
worksheet. What am I doing wrong, and what needs to be done to do it right?

Thanks,
Jason
 
Jason,

Have you tried locking all the cells, before protecting the sheet?...
Worksheets(1).Cells.Locked = True

Regards,
Jim Cone
San Francisco, USA


"Jason Kontkanen" <[email protected]>
wrote in message
Hello,
I've read various pages about locking ranges, protection, etc, but none of
it seems to work across the board. From VB, I'm opening a workbook, and the
entire thing should be locked. The user should be able to scroll and see
everything, but they shouldn't be able to edit anything. I specify read
only when I open it, and i call .Protect for the workbook, and as a test I
do .Protect DrawingObjects:=True, Contents:=True, Scenarios:=True,
UserInterfaceOnly:=True to protect the only sheet in the workbook. What
ends up happening is part of the worksheet is protected, but not the entire
worksheet. What am I doing wrong, and what needs to be done to do it right?
Thanks,
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top