Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default VB to protect cells not working in Excel 2003?

I have a spreadsheet we send to numerous vendors that has all the formula
cells protected. We just received a file back from a vendor with incorrect
formulas in it that the vendor should not have been able to change. I'm
reasonably sure the file went to the vendor protected, and I'm trying to
figure out what happened. The file was created in Excel 2002 and works fine
in Excel 2000. The vendor has Excel 2003 which I don't have access to for
testing, and I'm wondering if the protection does not work in the newer Excel
version. I've included the code below. Thanks for any help on this.

Sheets("Period 1").Select
ActiveSheet.Unprotect Password:="vendorprotect"
Cells.Select
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Locked = True
'Unprotect Weeks Performance and Plan Units
Range("T7:T120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("V7:V120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("A1").Select
ActiveSheet.Protect Password:="vendorprotect", DrawingObjects:=True,
Contents:=True, Scenarios:=True
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VB to protect cells not working in Excel 2003?

worksheet protection is easily broken.

It is supported in all current versions of excel, but as I said it is not
hard to break.

here is some free code to do it:

http://www.mcgimpsey.com/excel/removepwords.html

as an example.

Was your code locked so they couldn't go in and look at the password?

also, perhaps they did a copy and paste to a new sheet in another workbook.
then used that unprotected sheet to replaced your sheet. That worked for
me. (it wouldn't work completely if formulas are hidden).

--
Regards,
Tom Ogilvy


"cottage6" wrote in message
...
I have a spreadsheet we send to numerous vendors that has all the formula
cells protected. We just received a file back from a vendor with

incorrect
formulas in it that the vendor should not have been able to change. I'm
reasonably sure the file went to the vendor protected, and I'm trying to
figure out what happened. The file was created in Excel 2002 and works

fine
in Excel 2000. The vendor has Excel 2003 which I don't have access to for
testing, and I'm wondering if the protection does not work in the newer

Excel
version. I've included the code below. Thanks for any help on this.

Sheets("Period 1").Select
ActiveSheet.Unprotect Password:="vendorprotect"
Cells.Select
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Locked = True
'Unprotect Weeks Performance and Plan Units
Range("T7:T120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("V7:V120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("A1").Select
ActiveSheet.Protect Password:="vendorprotect", DrawingObjects:=True,
Contents:=True, Scenarios:=True



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default VB to protect cells not working in Excel 2003?

Hi Tom, thanks for the response. Yes, the code was password protected so the
vendor couldn't see the code unless he guessed what the password was to
unlock it. Interesting thought about copying the worksheet; maybe I'll call
the vendor and just ask him what he did. Thanks again.

"Tom Ogilvy" wrote:

worksheet protection is easily broken.

It is supported in all current versions of excel, but as I said it is not
hard to break.

here is some free code to do it:

http://www.mcgimpsey.com/excel/removepwords.html

as an example.

Was your code locked so they couldn't go in and look at the password?

also, perhaps they did a copy and paste to a new sheet in another workbook.
then used that unprotected sheet to replaced your sheet. That worked for
me. (it wouldn't work completely if formulas are hidden).

--
Regards,
Tom Ogilvy


"cottage6" wrote in message
...
I have a spreadsheet we send to numerous vendors that has all the formula
cells protected. We just received a file back from a vendor with

incorrect
formulas in it that the vendor should not have been able to change. I'm
reasonably sure the file went to the vendor protected, and I'm trying to
figure out what happened. The file was created in Excel 2002 and works

fine
in Excel 2000. The vendor has Excel 2003 which I don't have access to for
testing, and I'm wondering if the protection does not work in the newer

Excel
version. I've included the code below. Thanks for any help on this.

Sheets("Period 1").Select
ActiveSheet.Unprotect Password:="vendorprotect"
Cells.Select
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Locked = True
'Unprotect Weeks Performance and Plan Units
Range("T7:T120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("V7:V120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("A1").Select
ActiveSheet.Protect Password:="vendorprotect", DrawingObjects:=True,
Contents:=True, Scenarios:=True




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VB to protect cells not working in Excel 2003?

The password to the VBE is easily broken, too. (So don't trust it, either!)

And if you open the .xls file in notepad, you may be able to find enough to
unprotect a worksheet.

But I'd put my money on something like the link to J.E. McGimpsey.

cottage6 wrote:

Hi Tom, thanks for the response. Yes, the code was password protected so the
vendor couldn't see the code unless he guessed what the password was to
unlock it. Interesting thought about copying the worksheet; maybe I'll call
the vendor and just ask him what he did. Thanks again.

"Tom Ogilvy" wrote:

worksheet protection is easily broken.

It is supported in all current versions of excel, but as I said it is not
hard to break.

here is some free code to do it:

http://www.mcgimpsey.com/excel/removepwords.html

as an example.

Was your code locked so they couldn't go in and look at the password?

also, perhaps they did a copy and paste to a new sheet in another workbook.
then used that unprotected sheet to replaced your sheet. That worked for
me. (it wouldn't work completely if formulas are hidden).

--
Regards,
Tom Ogilvy


"cottage6" wrote in message
...
I have a spreadsheet we send to numerous vendors that has all the formula
cells protected. We just received a file back from a vendor with

incorrect
formulas in it that the vendor should not have been able to change. I'm
reasonably sure the file went to the vendor protected, and I'm trying to
figure out what happened. The file was created in Excel 2002 and works

fine
in Excel 2000. The vendor has Excel 2003 which I don't have access to for
testing, and I'm wondering if the protection does not work in the newer

Excel
version. I've included the code below. Thanks for any help on this.

Sheets("Period 1").Select
ActiveSheet.Unprotect Password:="vendorprotect"
Cells.Select
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Locked = True
'Unprotect Weeks Performance and Plan Units
Range("T7:T120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("V7:V120").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("A1").Select
ActiveSheet.Protect Password:="vendorprotect", DrawingObjects:=True,
Contents:=True, Scenarios:=True





--

Dave Peterson
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
Excel 2003 won't let me click on a button when i protect document Brenda Excel Discussion (Misc queries) 1 October 22nd 08 02:32 AM
Excel 2003 Protect file from being deleted L. Roper Excel Discussion (Misc queries) 1 February 27th 08 04:05 PM
how to totally protect data excel 2003 gibsol Excel Discussion (Misc queries) 1 March 23rd 07 02:55 AM
Can't protect some cells in Excel 2003 JMC Excel Discussion (Misc queries) 1 July 26th 06 03:36 PM
Macro working in Excel 2003; not working in Excel 2000 Leslie Barberie Excel Programming 5 May 20th 04 07:51 PM


All times are GMT +1. The time now is 01:26 AM.

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"