#1   Report Post  
LAF
 
Posts: n/a
Default Lock Project


I have a project that I am trying to lock with a password to prevent our
users from changing it and seeing the code. I have gone into the Visual
Basic code. I then selected Tools - VBA Project Properties. Then I
went into the Protection tab and checked the box in Lock Project and
entered a password. I then saved my file. When I open it up again and
make a change on any of the sheets, it allows me to save the file even
without putting in the password. I thought with the password set, you
wouldn't be able to make changes and save it? Is there a way to
prevent this because we don't want any of our users disabling the
macros and then making changes to the sheets?


--
LAF
------------------------------------------------------------------------
LAF's Profile: http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271

  #2   Report Post  
Earl Kiosterud
 
Posts: n/a
Default Lock Project

LAF,

Locking the projects hides the VBA code. If you don't want people to be
able to open the workbook at all, you need to assign a Password to Open or
Password to Modify, as needed, in the Tools dropdown of the Save-As dialog.
This is for Excel 2002; you don't say which version you're using.

Earl Kiosterud
www.smokeylake.com

"LAF" wrote in message
...

I have a project that I am trying to lock with a password to prevent our
users from changing it and seeing the code. I have gone into the Visual
Basic code. I then selected Tools - VBA Project Properties. Then I
went into the Protection tab and checked the box in Lock Project and
entered a password. I then saved my file. When I open it up again and
make a change on any of the sheets, it allows me to save the file even
without putting in the password. I thought with the password set, you
wouldn't be able to make changes and save it? Is there a way to
prevent this because we don't want any of our users disabling the
macros and then making changes to the sheets?


--
LAF
------------------------------------------------------------------------
LAF's Profile:
http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271



  #3   Report Post  
Jim Rech
 
Posts: n/a
Default Lock Project

VBE protection protects code in the VBE. It has no affect on changes in
Excel or the ability to save a workbook. Your best protection against a
user saving changes is to put the file in a location where users do not have
Write rights. Of course they could save a copy elsewhere.

Also, there is nothing you can do to prevent users from disabling macros.
(Wouldn't virus writers have a field day if there were?)

--
Jim
"LAF" wrote in message
...

I have a project that I am trying to lock with a password to prevent our
users from changing it and seeing the code. I have gone into the Visual
Basic code. I then selected Tools - VBA Project Properties. Then I
went into the Protection tab and checked the box in Lock Project and
entered a password. I then saved my file. When I open it up again and
make a change on any of the sheets, it allows me to save the file even
without putting in the password. I thought with the password set, you
wouldn't be able to make changes and save it? Is there a way to
prevent this because we don't want any of our users disabling the
macros and then making changes to the sheets?


--
LAF
------------------------------------------------------------------------
LAF's Profile:
http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271



  #4   Report Post  
LAF
 
Posts: n/a
Default Lock Project


We are using Excel 2002. If I set a password to open the file, is there
code I can put in the Workbook_Open event to automatically open the file
when they Enable macros instead of having the user have to enter the pw.
We don't want to give the pw to the users.


--
LAF
------------------------------------------------------------------------
LAF's Profile: http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271

  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default Lock Project

If you don't want them to have to enter a password, then don't use one.

Allowing the user to open the workbook just by clicking the enable macros button
doesn't seem too secure to me.



LAF wrote:

We are using Excel 2002. If I set a password to open the file, is there
code I can put in the Workbook_Open event to automatically open the file
when they Enable macros instead of having the user have to enter the pw.
We don't want to give the pw to the users.

--
LAF
------------------------------------------------------------------------
LAF's Profile: http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271


--

Dave Peterson


  #6   Report Post  
LAF
 
Posts: n/a
Default Lock Project


In my file, when they enable macros, I have code that protects the
sheets so that they can't change them. The problem is that if they
open the file and disable macros, we don't want them to make any
changes to the sheets and then save the file. That is why I need to
have a pw or something when the open the file, so that if they disable
macros, they would need the pw (but we wouldn't give it to our users to
prevent them from making changes to the file). When I enable macros, I
want code that automatically enter the pw for them.


--
LAF
------------------------------------------------------------------------
LAF's Profile: http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271

  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default Lock Project

First, both VBA Project and worksheet/workbook protection (via tools|protection
dialog) is very easy to break. So all your techniques (including the following)
can still fail with an experienced user--or a dedicated snooper.

But you may want to consider another alternative.

Give the that workbook a nice password to open. But don't share it with anyone
(except your out-of-office backup person).

Then create a dummy workbook that opens the workbook automatically when it's
opened. If the user disables macros, then the code in the dummy workbook can't
open the real workbook. (Have some notes on the first worksheet explain that if
the message doesn't go way, then they should close this workbook and open it
with macros enabled. If macros are enabled, then this message will disappear
pretty quickly.)

If the user allows macros, then the dummy workbook opens the real workbook and
closes itself.

This is what the code in the dummy workbook could look like:

Option Explicit
Sub auto_open()
Workbooks.Open Filename:="\\path\path\path\book2.xls", _
UpdateLinks:=1, Password:="hithere"
ThisWorkbook.Close savechanges:=False
End Sub

or

Option Explicit
Sub auto_open()
Workbooks.Open Filename:=thisworkbook.path & "\book2.xls", _
UpdateLinks:=1, Password:="hithere"
ThisWorkbook.Close savechanges:=False
End Sub

Remember to protect that project, too--else someone may see the password to the
real workbook.

LAF wrote:

In my file, when they enable macros, I have code that protects the
sheets so that they can't change them. The problem is that if they
open the file and disable macros, we don't want them to make any
changes to the sheets and then save the file. That is why I need to
have a pw or something when the open the file, so that if they disable
macros, they would need the pw (but we wouldn't give it to our users to
prevent them from making changes to the file). When I enable macros, I
want code that automatically enter the pw for them.

--
LAF
------------------------------------------------------------------------
LAF's Profile: http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271


--

Dave Peterson
  #8   Report Post  
Simon Chang
 
Posts: n/a
Default Lock Project

Easy way, you have to choice to secure your workbook.
Go to menus (Tools Options Security Password to open / Password to
modify).

Create a password using macros is not really effective.

Good luck.

"LAF" wrote in message
...

We are using Excel 2002. If I set a password to open the file, is there
code I can put in the Workbook_Open event to automatically open the file
when they Enable macros instead of having the user have to enter the pw.
We don't want to give the pw to the users.


--
LAF
------------------------------------------------------------------------
LAF's Profile:

http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=482271



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
How to project the due date according to a number of working hours Eric Excel Discussion (Misc queries) 8 October 24th 05 11:44 AM
Creating separate reports for each Project Manager Lorie Excel Discussion (Misc queries) 4 June 15th 05 02:26 PM
Missing library when running 98 project on 2003 Mary Omond Excel Discussion (Misc queries) 0 May 2nd 05 01:36 PM
Find project start and end dates in a DB with many different proje AceWriter01 Excel Worksheet Functions 3 April 1st 05 03:58 AM
Subtotal of Subtotal displays Grand Total in wrong row Thomas Born Excel Worksheet Functions 5 January 6th 05 01:46 PM


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

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"