ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   'very hidden' columns (https://www.excelbanter.com/excel-programming/309719-very-hidden-columns.html)

gavmer[_70_]

'very hidden' columns
 
HI all

Im after a simple macro that will unprotect sheet1, hide columns c-
and h-k and re-protect the sheet. Can an xlveryhidden function be use
as it is sensitive data being hidden?? Also, a click event to unhid
the columns would be needed.

Password protection (user prompt) would be needed also??

Any ideas??

Cheers to all!!!

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


JE McGimpsey

'very hidden' columns
 
First, if it's sensitive data, you should re-evaluate whether you should
be distributing it at all. Bypassing worksheet passwords is a matter of
a few seconds if you have the wherewithal to find these groups. See

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

Second, xlVeryHidden applies only to a worksheet's visibility, not to
columns.

Here's one way toggle hiding your columns:

Public Sub ToggleHiddenColumns()
Const sPWORD As String = "drowssap"
With ActiveSheet
.Unprotect sPWORD
With .Range("C:F,H:K").EntireColumn
.Hidden = Not .Hidden
End With
.Protect sPWORD
End With
End Sub

If you want the user to enter the password, here's one way:

Public Sub ToggleHiddenColumns()
Dim vPWord As Variant
With ActiveSheet
Do
vPWord = Application.InputBox( _
Prompt:="Enter Password:", _
Type:=2)
If vPWord = False Then Exit Sub 'User canceled
Loop Until Len(vPWord) 0
On Error GoTo Wrong_Password
.Unprotect vPWord
On Error GoTo 0
With .Range("C:F,H:K").EntireColumn
.Hidden = Not .Hidden
End With
.Protect vPWord
End With
Exit Sub
Wrong_Password:
MsgBox "That was the wrong password!"
End Sub





In article ,
gavmer wrote:

HI all

Im after a simple macro that will unprotect sheet1, hide columns c-f
and h-k and re-protect the sheet. Can an xlveryhidden function be used
as it is sensitive data being hidden?? Also, a click event to unhide
the columns would be needed.

Password protection (user prompt) would be needed also??

Any ideas??

Cheers to all!!!!


arno

'very hidden' columns
 
Hello,

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


Is this about Excel 2000, 2002, 2003 or also true for Add-Ins written
an protected with Excel 97? I somewhere heard that XL97 Add-Ins cannot
be cracked because the VBA-Password-Protection worked in a different
way. So, does it make sense to use XL97 to make "unbreakable" files
(that do not need functions added in later versions)?

regards

arno


JE McGimpsey

'very hidden' columns
 
The technique works for VBA add-ins, too, though the macro would require
some modification, or the add-in would have to be restored to a workbook
- which takes all of about 2 seconds in the VBE. It's true that VBA
Password protection is different than worksheet protection, but it can
be bypassed as, or more, easily than worksheet protection. It's anything
but "unbreakable".

Compiled add-ins (COM add-ins) are not susceptible to this technique.
However XL97 doesn't support COM add-ins.

The bottom line is that XL is an extremely poor application for keeping
data secure.



In article ,
"arno" wrote:

Is this about Excel 2000, 2002, 2003 or also true for Add-Ins written
an protected with Excel 97? I somewhere heard that XL97 Add-Ins cannot
be cracked because the VBA-Password-Protection worked in a different
way. So, does it make sense to use XL97 to make "unbreakable" files
(that do not need functions added in later versions)?



All times are GMT +1. The time now is 12:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com