Protecting hidden columns

mickygoalie

New Member
Joined
Nov 23, 2010
Messages
18
Hi
I have a workbook that has hidden columns in. There is protection on the workbook to ensure that other users cannot see the hidden columns. I have just realised that if they save the document using a different file name they can then view the hidden columns. Is there anyway I can prevent this from happening?
Thanks for any help
Mickygoalie
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
are you using vba to set the password ?
 
Upvote 0
I was wondering how a different file name would make it available, and presumed you were using the workbook name in the protection
 
Upvote 0
Hi,
The spreadhseet i am using just has a password on the worksheet using the protection option but when other users either rename or copy and paste the workbook the hidden columns become unprotected. this is causing us major issues and I am looking for a solution to this

thanks
Micky
 
Upvote 0
Paste this into the Thisworkbook module. Will that work for you?

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then MsgBox "You are not allowed to Save this Workbook under another Name"
Cancel = SaveAsUI
End Sub
 
Upvote 0
Micky,

My suggestion only solves one problem - preventing your users from (like you said) "if they save the document using a different file name" -- Stil howver, they can Copy and Paste to a new Workbook and then unhide the columns. I have another macro that prevents a user from using the Copy and Paste, but it is in xl2003 (The Pre-Ribbon days). So it doesn't work in xl2007.

Good luck,

Jim
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top