C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Protecting Workbooks and Worksheets

rated by 0 users
This post has 4 Replies | 1 Follower

Not Ranked
Posts 4
Deirdre Posted: Wed, Jan 21 2009 3:17 AM

Hi,

I'm trying to protect a workbook and it's worksheets. There does not seem to be an option .protect like in VB or VBA. There is an option .Locked but this does not protect the workbook or worksheets. Would anyone know how this can be done?

Thanks,

Dee. 

 

Top 25 Contributor
Posts 477
Hi Dee,

try to lock not only the cells, but also the XLSheet.

From the doc to XLSheet.Locked:

"Sheets and styles can be locked. By default, sheets are unlocked and styles are
locked. This combination allows users to edit the cells in Excel.

To protect a cell against editing in Excel, both the sheet and the cell style
must have the Locked property set to true.

To lock most cells on a sheet and allow editing of only a few cells, lock the
sheet, then create an unlocked style and assign it to the cells that should be
editable."

Hope this helps

Wolfgang
Not Ranked
Posts 4
Deirdre replied on Wed, Jan 21 2009 6:19 AM

Thanks Wolfgang, that works.

 Dee.

Not Ranked
Posts 4
Deirdre replied on Wed, Feb 25 2009 8:53 AM

Hi Wolfgang,

Is there any way of protecting the worksheets with passwords?

 Thanks,
Dee.

Top 25 Contributor
Posts 477
Hi Dee,

I am quite sure that C1Excel does not support this.

Best regards

Wolfgang
Page 1 of 1 (5 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.