Consulting

Results 1 to 12 of 12

Thread: Protect excel workbook

  1. #1

    Protect excel workbook

    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

  2. #2
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    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
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    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)

  4. #4
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Quote Originally Posted by Antony21
    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!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  5. #5
    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".

  6. #6
    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.

  7. #7
    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.

  8. #8
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Look at our kb entries heres one for setting a trial period
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  9. #9
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Quote Originally Posted by Antony21
    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?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  10. #10
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Quote Originally Posted by Ken Puls
    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.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  11. #11
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    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.)
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  12. #12
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Quote Originally Posted by Ken Puls
    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!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •