prvent viewing a workbook

T

tofimoon4

Dear sir,with best regards,asking you kindly to help me by a code t
prevent anyone opening my workbook after one week from starting date ,i
another words ( anyone cannot open the workbook after one week withou
entering my password).
Thanks in advance
 
S

Simon Lloyd

tofimoon4;430307 said:
Dear sir,with best regards,asking you kindly to help me by a code t
prevent anyone opening my workbook after one week from starting date ,i
another words ( anyone cannot open the workbook after one week withou
entering my password)
Thanks in advance.You would need to add a worksheet and make all other sheet
xlveryhidden, so that if the workbook is opened with macro's dissable
they still cannot view the worksheets, then if macro's are enabled yo
need to pop up a userform on workbook_open with a textbox and comman
button. Is this what you envisaged

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
T

tofimoon4

Dear sir,with many thanks for your interest,i have clarification a bou
this request,i have asked by a company to provide them with a ful
program by excel against a sum , i want to give them an experientia
copy(with all details ,without any protection ) before selling ,th
period for checking this copy by them is one week then the agreemen
should be signed .
Hopping i was clear
 
M

Mike H

Simon,
xlveryhidden, so that if the workbook is opened with macro's dissabled
they still cannot view the worksheets

Even with macros disabled there is nothing to stop a user opening VB editor
and changing the sheet to XlVisible in the properties window.

The reality is that a password to open isn't bad but can easily be broken
with something like passware but once the workbook is open anyone with
sufficient determination and Google can do whatever they want and you can't
stop them.

Excel protection is designed to protect against inadvertant
deletions/changes and we kid ourselves and mislead the inexperienced if we
pretend otherwise.

Mike
 
P

Patrick Molloy

I understand.

You want to provide potential buyers of your work a demonstration copy that
will expire after a certain time

This is difficult to do with Excel as the security is very easy to "crack"
I suggest you follow Simon's suggestion.
For the code .. just give them the smallest amount that can show what can be
done .. . but not all of it, so that they need to full code for the workbook
to run completely
secure the VBA Project --- use as long a password as possible! it can still
be broken. but if the demo has code removed, then that will not be such a
big problem

I'd also suggest a xlVeryHidden spreadsheet. Onto this, put the date at
which you delivered the workbook. If the system date is earlier, you can
force the book to close again.

good luck
 
S

Simon Lloyd

Mike i am aware of the limitations with excel as i assume most peopl
are, i was simply giving the OP suggestions as to how it can b
achieved, without the first step of forcing macro's to be enabled hi
endeavours will be undone

To be honest i believe the OP should either convert his workbook to a
exe or find another application if he is to sell his product, however
if he is to sell a product with user restriction/limitation he would b
wise to first learn how to achieve these himself as maintenance will b
soley down to him :

QUOTE=Mike H;430334]Simon
xlveryhidden, so that if the workbook is opened with macro' dissable
they still cannot view the worksheet

Even with macros disabled there is nothing to stop a user opening V
edito
and changing the sheet to XlVisible in the properties window

The reality is that a password to open isn't bad but can easily b
broke
with something like passware but once the workbook is open anyone wit
sufficient determination and Google can do whatever they want and yo
can'
stop them

Excel protection is designed to protect against inadvertan
deletions/changes and we kid ourselves and mislead the inexperienced i
w
pretend otherwise

Mik


tofimoon4;430307 Wrote other sheet
xlveryhidden, so that if the workbook is opened with macro' dissable
they still cannot view the worksheets, then if macro's are enable yo
need to pop up a userform on workbook_open with a textbox and comman
button. Is this what you envisaged

-
Simon Lloy
Regards
Simon Lloy
'The Code Cage' ('The Code Cage - Microsoft Office Help - Microsof
Office Discussion' (http://www.thecodecage.com)

-----------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simo
Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: 'prvent viewing a workbook - The Code Cage Forums
(http://www.thecodecage.com/forumz/showthread.php?t=119540



--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
M

Mike H

Hi,

While not disagreeing with the other advice you have been given, the
protection provided is only of use for protecting the workbook from 'honest'
users making inadverdant changes.

If you hope to sell your workbook then giving a copy away with this type of
'protection' is most unwise and will compromise the possibility of your
selling it if the potential purchaser is inclined not to pay. But there are
methods.

Folow the link below

http://www.cpearson.com/excel/workbooktimebomb.aspx

and this one

http://www.cpearson.com/excel/creatingcomaddin.aspx

Mike
 
T

tofimoon4

Dear sirs,i have seen the below code in another forum but dono
understand a sentence written with ,which was (Here is one very simpl
method, that is far from secure, but enough for most cases).
Private Sub Workbook_Open()
' Range "DateCheck" Is a named cell on XlVeryHiden Sheet.
If Range("TimeCheck") <> vbNullString Then ' Date has been set.
'Check date.
If Range("TimeCheck") < Date - 30 Then 'Expired
'Your passord Code HERE
End If
Else 'Set first Open date
Range("TimeCheck") = Date
Me.Save
End If
End Sub
Hopping you shall give me your advice about
 
S

Simon Lloyd

Tofimoon4, they are simply stating that excel's security/protection i
very poor!, anyone, even you, with enough determination and google ca
bypass excel's security!, you must protect the vba project and you mus
use a method to force macro's to be enabled, there is an example her
'Code Cage Downloads - The Code Cage Forums
(http://www.thecodecage.com/forumz/local_links.php?catid=2&linkid=3
that delete's the workbook after a certain date.....if you must go thi
route against advice then post back

tofimoon4;430358 said:
Dear sirs,i have seen the below code in another forum but dono
understand a sentence written with ,which was (Here is one very simpl
method, that is far from secure, but enough for most cases) Code
-------------------
Private Sub Workbook_Open()
' Range "DateCheck" Is a named cell on XlVeryHiden Sheet.
If Range("TimeCheck") <> vbNullString Then ' Date has been set.
'Check date.
If Range("TimeCheck") < Date - 30 Then 'Expired
'Your passord Code HERE
End If
Else 'Set first Open date
Range("TimeCheck") = Date
Me.Save
End If
End Su
-------------------

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
T

tofimoon4

Dear sir,when i tried to open any file from the address you hav
registered ,this sentence was appear (Sorry - there is nothing here t
show you (no permission, all entries hidden, etc).
Thank you for help and consider the request was solved
 
S

Simon Lloyd

tofimoon4;430383 said:
Dear sir,when i tried to open any file from the address you hav
registered ,this sentence was appear (Sorry - there is nothing here t
show you (no permission, all entries hidden, etc)
Thank you for help and consider the request was solved.Yes my fault, you have to go through the disclaimer gateway first her
'Code Cage Downloads - The Code Cage Forums
(http://www.thecodecage.com/forumz/local_links.php

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
Top