Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GCF GCF is offline
external usenet poster
 
Posts: 1
Default Protection lost on Open

It is my intention to disable users from selecting any cells on
worksheet that I have just created in a workbook using EXCEL 2002. New
to VB, I rely greatly on recording macros then cut/paste. In this case
I did a Ctl+A to select all cells, then FormatCells - Protection,
checked Locked & Hidden and then "OK". Then I went to
ToolsProtectionProtect Sheet. With the exception of "Protect
worksheet and contents of locked cells" all boxes were unchecked when I
hit "OK". The following code was generated:

Cells.Select
Range("C3").Activate
Selection.Locked = True
Selection.FormulaHidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Cells.Select
Range("C3").Activate

If I then unprotect the worksheet and run the macro, as intended, all
cells are not selectable.

The problem I have is that if the workbook is closed and reopened,
cells are once again selectable and can be copied. Is there a
programmable solution for retaining the protection as implemented?

Thanks,
GCF


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Protection lost on Open

I suggest that you do it the othjer way around.
Protect the cells & worksheet then save the workbook.
That way, protection is ON when opened. Use the VBA code
to remove the proetection - use a password. Remember
though that you must keep a note of the password !!!

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
It is my intention to disable users from selecting any

cells on
worksheet that I have just created in a workbook using

EXCEL 2002. New
to VB, I rely greatly on recording macros then

cut/paste. In this case
I did a Ctl+A to select all cells, then FormatCells -

Protection,
checked Locked & Hidden and then "OK". Then I went to
ToolsProtectionProtect Sheet. With the exception

of "Protect
worksheet and contents of locked cells" all boxes were

unchecked when I
hit "OK". The following code was generated:

Cells.Select
Range("C3").Activate
Selection.Locked = True
Selection.FormulaHidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Cells.Select
Range("C3").Activate

If I then unprotect the worksheet and run the macro, as

intended, all
cells are not selectable.

The problem I have is that if the workbook is closed and

reopened,
cells are once again selectable and can be copied. Is

there a
programmable solution for retaining the protection as

implemented?

Thanks,
GCF


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Protection lost on Open

Hi

The problem GCF is having is similar to mine

Marcos in Templates "Dick Johnson"
Dec 21 2003 9:30PM

When I open a template form as a new doc the protection is
lost. I save the form template with the protection on.



-----Original Message-----
I suggest that you do it the othjer way around.
Protect the cells & worksheet then save the workbook.
That way, protection is ON when opened. Use the VBA code
to remove the proetection - use a password. Remember
though that you must keep a note of the password !!!

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
It is my intention to disable users from selecting any

cells on
worksheet that I have just created in a workbook using

EXCEL 2002. New
to VB, I rely greatly on recording macros then

cut/paste. In this case
I did a Ctl+A to select all cells, then FormatCells -

Protection,
checked Locked & Hidden and then "OK". Then I went to
ToolsProtectionProtect Sheet. With the exception

of "Protect
worksheet and contents of locked cells" all boxes were

unchecked when I
hit "OK". The following code was generated:

Cells.Select
Range("C3").Activate
Selection.Locked = True
Selection.FormulaHidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Cells.Select
Range("C3").Activate

If I then unprotect the worksheet and run the macro, as

intended, all
cells are not selectable.

The problem I have is that if the workbook is closed and

reopened,
cells are once again selectable and can be copied. Is

there a
programmable solution for retaining the protection as

implemented?

Thanks,
GCF


---
Message posted from http://www.ExcelForum.com/

.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost Protection Password Davros Excel Discussion (Misc queries) 2 June 30th 08 01:39 AM
Password protection lost pd Excel Discussion (Misc queries) 2 October 12th 05 03:03 PM
Password protection lost pd New Users to Excel 1 October 12th 05 12:05 AM
Cell protection in Excel is lost when file is uploaded to website. Mandrake Excel Discussion (Misc queries) 0 March 15th 05 04:53 PM


All times are GMT +1. The time now is 03:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"