Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Password protection

Here is the situation

I have a spreadheet that cycles monthly data.
Each sheet is a new month and 12 are kept in the book
I have a macro that copies information from each sheet to the next showing the last quarter of context for each sheet
Of course only the new quarter's information is editable or should be
So I need to have my macro copy protected information
If the protection is not passworded then I can turn it off, copy, and turn it on
But all the users know this as well and they turn off the protection and ruin the formulas, etc
Further if I password protect it then copying protected cells requires password entry which dosent work because I do not want the users to have the password.
So I need a way to BYPASS the password protection that works for the macro. Id there one

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Password protection

Series0, you can have your macro unprotect the sheet, run you code and then
protect the sheet, something like this

ActiveSheet.Unprotect password:="123"
'you code here
ActiveSheet.Protect password:="123"



Or you can still run a macro on a sheet when it is protected using user
inter face only, like this
ActiveSheet.Protect UserInterfaceOnly:=True

Or with a password
ActiveSheet.Protect UserInterfaceOnly:=True, password:="123"

Sheets("Sheet2").Protect UserInterfaceOnly:=True, password:="123"


You can also lock the VBA project to keep someone from seeing the password
in the code, To protect the VBA project, from your workbook right-click the
workbook's icon and pick View Code. This icon is to the left of the "File"
menu this will open the VBA editor, in the left hand window right click on
your workbook name and select VBA project properties, protection, check lock
project for viewing and set a password. Press Alt and Q to close this window
and go back to your workbook and save and close the file
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"series0" wrote in message
...
Here is the situation:

I have a spreadheet that cycles monthly data.
Each sheet is a new month and 12 are kept in the book.
I have a macro that copies information from each sheet to the next showing

the last quarter of context for each sheet.
Of course only the new quarter's information is editable or should be.
So I need to have my macro copy protected information.
If the protection is not passworded then I can turn it off, copy, and turn

it on.
But all the users know this as well and they turn off the protection and

ruin the formulas, etc.
Further if I password protect it then copying protected cells requires

password entry which dosent work because I do not want the users to have the
password.
So I need a way to BYPASS the password protection that works for the

macro. Id there one?



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
Password protection in macro ( Anybody can view my password in VB Sherees Excel Discussion (Misc queries) 2 January 24th 10 10:05 PM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
password protection MelB Excel Discussion (Misc queries) 2 November 11th 07 02:55 AM
Password Protection Duncan, UK Excel Discussion (Misc queries) 2 September 18th 06 04:37 PM
Password Protection ElsiePOA Excel Discussion (Misc queries) 6 July 25th 06 05:25 AM


All times are GMT +1. The time now is 05:46 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"