Self Destruct Workbook After Not Logging In Within 30 Days

  • I need a macro that records users accessing a workbook over a network and if I have not logged in after a 30 day period it will replace all calculations with data and if possible wipe all macros.
    I have tried to nut this out but time is against me.

    I have had my work taken to other sites within our business and passed of as their work, and it bugs me.

    Any help will be greatly apreciated.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    if you password protect your project you can bulid in other criteria such as if the usernameisn't yours open read only or close workbook or if its not your machine close workbok or open read only

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Excel is notorious for lousy password protection and I want to disable the Workbook entirely, making it unusable.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Do you want it to be run when anyone opens it after 30 days? Of course, if they don't enable amcros and are savvy enough to open the VBA Project then you are wasting your time. The VBA password is reasonably stong,so that would stop most users. If they can crack the VBA password then you would need an even stronger method,for an almost foolproof method see this.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Here are some ideas that come to my mind as I read this intriguing post:

    IF there is some way that the user can only access your spreadsheet across the Internet, then you would have control of their access to the application.

    Is there is some way that all the essential formulas might be updated remotely, each time the spreadsheet is loaded, and then delete them before the data is saved?

    Is it possible to write some active-x add-in component which you could control in some fashion?

    Or perhaps your application could require a password based upon month and year, and each month they would have to contact you for the new password?

    I used to see applications with "key" devices that plugged into the parallel port. You could not run the application unless you purchased a key, and installed it on the machine.

    Or, is there some way to encrypt their data, such that you can control the manner in which it is unencrypted. Or is it possible to design an excel spreadsheet which remotely loads the data across the Internet (from a site that you control, of course) and in that fashion, you would always hold their data captive.

    Obviously, legal contractual agreements are a different way to enforce the use of your software creations.

    I once purchased a license for a World Clock application which would show the time and date of as many countries as you please to add. The application would constantly communicate with their server, which could detect if the application was running on two machines. The moment their server detected an unauthorized installation, it would deactivate the program on BOTH machines, and require you to purchase an additional license. I dont know if Excel applications can be configured in such a fashion.

    Suppose there was some programming language, that you could compile and control, which would CONTAIN within it, encrypted, your entire Excel spreadsheet application. Each time the user wanted to use your application, they would launch THAT program, which would construct the Excel spreadsheet, and populate the data (perhaps encrypted in some sql application). When the user exits your application, it backs up all the data into that external encrypted database, and then deletes or destroys itself. If all this is possible, then you would have control of the program which reconstitutes the spreadsheet. And I suppose, if you could develop such a "meta-application" which could automatically encapsulate any spreadsheet app, well then you would have something marketable to others who desire such security or control.

    Suppose your client user were to sign a contractual agreement with you to lease a computer from you which runs your Excel spreadsheet. That computer would be heavily protected with encryption and passwords in some fashion, and would only run when connected to the Internet, and would give you total control over it's use. Of course, in such a circumstance, a user might be justifiably concerned that at some future time, you would be holding their data captive. They might want some clause that allows them a one-time export of their data to machine readible format before either party dissolves the relationship.

    Hardware protection devices are called "dongles" (among, presumably, many other things.
    Here is a "dongle overview" by a company which is probably fairly high tech. The dongle plugs into a USB port (and they have parallel port dongles). You lace your application with periodic calls to the dongle. Now, what I am trying to find out is whether they have a dongle which can be contacted and configured remotely, across the Internet. Their literature does make one noteworthy statement: Software protection should make it more expensive to pirate software than to purchase it.

    Here is a dongle which mentions remote internet configuration. Here is an illustration of how that remote dongle update works. Now, I only have to find out how to make calls to the dongle via VBA (and of course, there must be some way to protect the VBA so that some rascal does not simply remove the calls).

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    I did some searching on the topic of compiling Excel spreadsheets. I came across this


    I searched this forum on KDCALC, but found no mention of it.

    It does not seem to be able to compile VBA code, although it mentions something about porting VBA to It does sound like a way to develop a spreadsheet that one might completely control.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Dunno if it's what you're after, but you could try Orlandos Excel to Exe (it's free)

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Hmmm, I have an idea of how this could work, however, my ethics do not allow me to convulge this information; regardless of OzGrid rules.

    Trust me, I understand where you are coming from, but would like to offer a different approach. In most companies, maybe not yours, this "work" is not is the companys.

    So people steal your hard work and try to pass it off as their own? Instead of disabling and deleting the companies work, they paid everyone involved including you and the un-intelligent data thief, why not create an un-removable stamp?

    I don't know...your intent seems more spiteful than anything else so I'll stop here.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days


    Sicarii is right! In addition if your work is a company program you should have it well documented and accessible for compliance if containing or elaborating sensible data.

    A solution could be to E-mailed you the code and print it out with the incoming date and hour or send it to you via post ( keep the envelope closed! you have the post stamp as proof ) to be able, in case of "piracy", to dismask the thief.

    A second possibility could be to copy the program on a cd/dvd with a (sub)directory system ( i.e ..\myPrgA\20070520,..\myPrgA\20070521 ) to keep track of the changes; via WinExplorer you can proof anyway when the file has been created.

    And finally, they can steal you everything but not your intelligence and creativity.


  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    I received a reply from my inquiry to the KEYLOK folks, which suggests creating an add-in (so I searched here for how to create an add-in)

    Create an Addin

    I do think this is an interesting and useful topic in general, apart from the particular circumstances of the original poster.

    Dear Karebac:

    Thank you for your email inquiring about KEYLOK protection for Excel Spreadsheets. Protecting spreadsheets is a little tricky but it can be done in such a way to provide good protection. I have outlined the steps required from a high level.

    The scheme used to protect an Excel Spreadsheet using KEYLOK security dongle is broken into three basic

    parts, as follows:

    o Create a block of code that is inaccessible to the end user that

    checks for the presence of the KEYLOK security device.

    o If the security device is found then make accessible other functions

    within this secure block of code that are required for your

    application to work.

    o Force the call to the secure block of code upon loading of your

    spreadsheet, and protect this call from being altered or removed.

    Periodically check for the continued presence of the security

    device to prevent someone from running more than one copy of your

    program with a single device.

    Providing a secure block of code can be accomplished in a number of ways. Using passwords to protect the VBA code, using the read-only and/or hidden features or to obtain maximum security for the secure block of code it could be converted into an add-in.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    I think you are going over the top, if your colleagues are only average Excel Users then all that is unnecessary. If not then a very experienced user should be able to overcome that code!

    As other's have pointed out, if it is developed at work, on work's computers then I am sure that legally the application belongs to work!

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Questions are like Pringles chips; one often leads to another, which is why posts are called threads or sutras (which shares the same root as suture)

    And, as I said, I am addressing myself to the broad concept of protection and control in general, rather than the circumstances of the initial poster, whom I initially assumed to be some consultant developer, because I read in haste.

    I personally am not advocating that anyone do, or not do, anything with regard to protection of an application. I admire the spirit and philosophy of open source, and if I am ever able to create anything useful, I shall most likely place it in public domain.

    But it is interesting to explore the hypothetical question of how one might protect a spreadsheet application, or even IF one can protect a spreadsheet application. I worked with a number of software applications that used dongles since 1980, and the first one was on a Radioshack TRS-80 Model I.

    Of course, simple users would be mystified by the simplest of protection schemes, and the most sophisticated hacker could break anything.

    One would imaging that a highly skilled programmer, capable of breaking protection, would much prefer to re-write the application from scratch. It would have to be some fairly proprietary spreadsheet to warrant great measures of protection.

    Also, I have heard it remarked that most legitimate users WANT to be legal, and avail themselves of support, maintenance, enhancements, etc.

    Perhaps some of these posts will be of benefit to someone who feels they have some legitimate reason to protect their work with a dongle, or by making it accessible only on the Internet.

    And, at least one of my ideas, in my previous post, might inspire someone to design a new kind of program, that attempts to encapsulate the Excel application in some way. Or perhaps develop a way to take an Excel application with VBA, and compile it, or convert it to run on the Internet. I am sure Microsoft is capable of such feats, if they feel that there is some market for it. Perhaps someone at Microsoft, on the Excel team, will read this and undertake some project.

    It is similar to that Lottery motto: "If you don't play, you can't win." If we don't "play around with ideas" then we perhaps will not stumble across a new one.

    It is probably worthwhile having new keywords like dongle enter the search engines just to attract whatever traffic might be foolishly or wisely searching on such keywords.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days


    Sorry, I thought your last post was by the originator of the Rhread, by all means throw ideas in.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    Both of us fell victim to that old sin of "post in haste, repent at leisure."

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    I think that several people out there are missing the point and I'll try to explain it a little more accurately.

    1. The workbooks were originally created on my own time at home as a model for a backup process that my current employer uses. We had no definitive backup process to employ should our systems go down.
    2. On the occasion that our system was unavailable for sixteen hours due to hardware failure we used my spreadsheets to provide the information to the relevant departments to manufacture and distribute bread products.
    3. The process I had created worked so well that it was instituted to augment our process and run in tandem creating a simultaneous dual system to supply the required information.
    4. As persons came and left our company they took copies of my worksheets with them as they were designed to work both within and outside our existing network.
    5. Most of these people had little knowledge of Excel and even less of VBA but enough intelligence to buy a password breaker for $20-$25 from the internet.
    6. I have found out that several other people are spreading these workbooks as their own and I know of one instance where a person I trained to use Excel has gone to a competitor and has secured employment using my workbooks.
    7. Litigation is not an option. Not only is it time consuming it is also very expensive and I do not have interest in pursuing these individuals. Eventually they will be found out for what they are.
    8. My interest is mainly within the data and the process to create (bread)formulations contained within these workbooks.

    Summary: I am no genius with Excel. I had enough knowledge of both our process and Excel to create something to fill a need. Some of the code and calculations were gleaned from sources such as this site and with help from Excel devotees from Pakistan, Japan and USA.
    I have given credit within the code to those people who have helped me and my employer is well aware of my limitations. I would like to secure the data as well as the code and calculations but if I can only secure the data I will be extremely happy.
    I am currently creating a new set of workbooks to integrate with our system that contains password access to the workbook but after speaking with my bosses they would like to see some form of added security for their data.

  • Re: Self Destruct Workbook After Not Logging In Within 30 Days

    I have posted lots of examples of hiding sheets & only displaying if the correct password is entered. My commercial work is protected in the way that I describe in the earlier link. I also, include an about code giving author, etc which obviously cannot be altered if the code is totally protected.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!