PDA

View Full Version : Protect excel workbook



Antony21
06-02-2008, 02:19 AM
Hi people!!!

I was trying to protect an workbook that uses vba code against changes by other users but since excel protection is too poor I need your help...

What I intend to do is allow the users of the workbook to use it until one fixed day (for instance, 30th June 2008). After this date the workbook should be inoperational.
In this case, I think that the best way is to use some code that checks the actual date and compares with the fixed date, allowing or not to use the workbook. Since anyone can alter computers' date, it is possible to check the date in the internet and only on that conditions allow to use the wb?

I also tried to use an external application, Lockxls, that seemed to do that, but with that application the macros were almost of impossible use do to an enormous increase on running time...

I will apreciate a lot if you can help me with this issue.
Thanks in advance

Simon Lloyd
06-02-2008, 02:26 AM
When you say "inoperational" what do you mean? never see the workbook again? or can't view the workbook? or can view it but can't make changes?....etc

Antony21
06-02-2008, 02:37 AM
Well, if the code that I have on the unprotected workbook can run in 1 min, using the protection of Lockxls, running the same code lasts for 16min..., which is a huge increase in running time (and that I cannot explay)

Simon Lloyd
06-02-2008, 02:44 AM
Well, if the code that I have on the unprotected workbook can run in 1 min, using the protection of Lockxls, running the same code lasts for 16min..., which is a huge increase in running time (and that I cannot explay)What has that got to do with my question? and it explains nothing further for me - if it's taking a long time to run the set the calculation to manual then back to automatic at the end!

Antony21
06-02-2008, 04:28 AM
Sorry, it was my fault.
By inoperational it mean to don't allow to use the workbook from that date one.
In the issue related with the time to run the code, I don't understand what you mean with "set the calculation to manual then back to automatic at the end".

wolf.stalker
06-02-2008, 05:32 AM
well, you could simpy do a check like on an open event to check the system date, and if it meets your predefigned date, then END...

just a thought as thats how i have done it for past apps that were in "beta" lol.

Antony21
06-02-2008, 06:20 AM
Its something like that, but I'd like to compare the allowed workbook date with the internet date in order to avoid changes in computer's date to continue using the workbook.

Simon Lloyd
06-02-2008, 08:10 AM
Look at our kb entries heres one for setting a trial period (http://vbaexpress.com/kb/getarticle.php?kb_id=475)

Ken Puls
06-02-2008, 09:24 PM
Its something like that, but I'd like to compare the allowed workbook date with the internet date in order to avoid changes in computer's date to continue using the workbook.

Just curious here... you think your users will go back and modify their system date to keep using your app? They'll live with the rest of the consequences from doing so, just to avoid paying you?

Simon Lloyd
06-03-2008, 12:49 AM
Just curious here... you think your users will go back and modify their system date to keep using your app? They'll live with the rest of the consequences from doing so, just to avoid paying you?True Ken, if there are any formulae that use Today(), Now(), Date and Time will all display the wrong data.

Ken Puls
06-03-2008, 11:12 PM
I was thinking the ramifications would be bigger than just Excel. Potential poor date stamping on emails, and who knows what else in other non-office programs. The app would have to be very very important to me to make that kind of a change to my system. (But that may just be me. I'm not saying it wouldn't happen, it just strikes me as unlikely.)

Simon Lloyd
06-03-2008, 11:21 PM
I was thinking the ramifications would be bigger than just Excel. Potential poor date stamping on emails, and who knows what else in other non-office programs. The app would have to be very very important to me to make that kind of a change to my system. (But that may just be me. I'm not saying it wouldn't happen, it just strikes me as unlikely.)Trust you to be all worldly wise Ken!