Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Protecting data on a sheet

I would like to setup my spreadsheet so that a user
cannot change the data after 1 week. What would be
a good way to block users from changing their own
data after 1 week or longer???

I figure, I can processed Workbook_Open() and test
how old the workbook is. From this point, is it simply
good enough to password protect the sheet???

I am not completely confident that the "Sheet Protect"
mechanism is completely secure, I mean, can't a skillful
user open up the VBA editor and write code to change
data on the protected sheet???



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Protecting data on a sheet

Hi!

To prevent people from changing data on your worksheet add a condition to
the code that unprotect your Excel sheet.

You can prevent people from getting access to VB Editor.

M Varnendra

"Robert Crandal" wrote:

I would like to setup my spreadsheet so that a user
cannot change the data after 1 week. What would be
a good way to block users from changing their own
data after 1 week or longer???

I figure, I can processed Workbook_Open() and test
how old the workbook is. From this point, is it simply
good enough to password protect the sheet???

I am not completely confident that the "Sheet Protect"
mechanism is completely secure, I mean, can't a skillful
user open up the VBA editor and write code to change
data on the protected sheet???



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Protecting data on a sheet

Excel is not totally safe from hackers and password crackers, but for your
normal users, you do the best you can. Yes, a Workbook_Open event can be
used to check today's date against the workbook's last modified date or
created date or a date 7 days prior to today, and then run your WS.Protect
code. Even that can be circumvented if a user were to change the computer
date back in time. You do the best you can. Also, you can password protect
your VBA code so the modules are not visible without a password. In the VBA
editor window under Tools/VBAProject Properties, there is a protection tab
to lock out code from being viewed.

Mike F
"Robert Crandal" wrote in message
...
I would like to setup my spreadsheet so that a user
cannot change the data after 1 week. What would be
a good way to block users from changing their own
data after 1 week or longer???

I figure, I can processed Workbook_Open() and test
how old the workbook is. From this point, is it simply
good enough to password protect the sheet???

I am not completely confident that the "Sheet Protect"
mechanism is completely secure, I mean, can't a skillful
user open up the VBA editor and write code to change
data on the protected sheet???





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Protecting data on a sheet

I would put the origin date in cell A1, lets say todays date. Then ensure
all the cells on the sheet are unlocked except A1, then protect the sheet.
This will allow the user to change whatever they want except cell A1.

Then you can put this code in the Workbook_Open Exvent:
_______________________________
Option Explicit

Private Sub Workbook_Open()

' if today is 7 days older than A1
If Date Format(Range("A1").Value + 7, "mm/dd/yyyy") Then

With Sheets("Sheet1")

' unprotect worksheet
.Unprotect "password"

' lock all cells
.Cells.Locked = True

' protect sheet
.Protect "password"
End With
End If

End Sub
_______________________________

This will lock all cells when the workbook is opened if the date the user
opens the workbook is 7 days older than A1. I used "password" as your
password, you may want to change that.

For the most part Excel protection is safe, but there is third party
software that can be used to crack passwords if you want to pay alittle money
for it.

Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"Robert Crandal" wrote:

I would like to setup my spreadsheet so that a user
cannot change the data after 1 week. What would be
a good way to block users from changing their own
data after 1 week or longer???

I figure, I can processed Workbook_Open() and test
how old the workbook is. From this point, is it simply
good enough to password protect the sheet???

I am not completely confident that the "Sheet Protect"
mechanism is completely secure, I mean, can't a skillful
user open up the VBA editor and write code to change
data on the protected sheet???



.

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
protecting formulas without protecting sheet so grouping still wor JM Excel Discussion (Misc queries) 1 June 4th 09 06:42 AM
password protecting a column for data entry in a sheet, how? kashi Excel Worksheet Functions 1 June 26th 07 03:09 AM
Protecting excel sheet for data input rdrnws Excel Discussion (Misc queries) 1 November 23rd 06 10:38 AM
Protecting excel sheet for data input rdrnws Excel Programming 1 November 23rd 06 10:38 AM
Protecting sheet disables import of extetrnal data in Excel 2003 MNord Excel Discussion (Misc queries) 0 August 31st 05 04:34 PM


All times are GMT +1. The time now is 12:32 PM.

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

About Us

"It's about Microsoft Excel"