Consulting

Results 1 to 7 of 7

Thread: Office 2007. Word and Excel

  1. #1
    VBAX Newbie
    Joined
    Apr 2019
    Location
    Udon Thani
    Posts
    4
    Location

    Office 2007. Word and Excel

    I have Word and Excel documents that I want to expire after a certain date unless an unlock code is entered.

    I know nothing about VBA really..well I wrote a script once that extracted information from a worksheet and pivot table, then extracted and combined data to make a third worksheet, reorganized the order of the rows, then deleted some columns and printed a report of the net remaining rows and columns. I learned how to to that online having no VBA experience but it took a month or more to get it to work..trial and error...mostly error. Frustrating as hell since I did not know even the basics.

    So the Word document and the Excel Workbook are preview documents for some of the work I do. I want to keep recipients from copying and distributing them and I thought about putting a date bomb in there allowing a 30 day preview. The document would fail to open beginning on the 31st day unless an unlock code is entered. How can I do that?

    Maybe open each document to a login page? Give them their 'initial password' within the email I send which works for 30 days from the date they first login unless I send them a Unlock password then the document opens for as long as necessary.

    I don't know how to prevent copying the Word document and Excel workbook and sending them to someone else or preventing the Document from opening on another computer. That would be nice as well. Basically I don't want my information shared.

    Thanks to anyone who can help.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,871
    Location
    Anything you try to do along those lines is easily defeated. Typically, all the user need do when opening the file is to not allow the macro to run. For example, if they save the opened document or workbook in the docx or xlsx format, respectively, that will kill off your macro altogether.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  3. #3
    VBAX Newbie
    Joined
    Apr 2019
    Location
    Udon Thani
    Posts
    4
    Location
    Quote Originally Posted by macropod View Post
    Anything you try to do along those lines is easily defeated. Typically, all the user need do when opening the file is to not allow the macro to run. For example, if they save the opened document or workbook in the docx or xlsx format, respectively, that will kill off your macro altogether.
    Thanks for that information. Some time ago I opened a Word document from an online source to view the contents and as I remember I was only able to Save...not Save As and many of the editing button were grayed out and unavailable. I remember thinking that I might use similar techniques to protect my IP if I moved forward with the project.

    If any of this sounds possible or if you can think of a method to protect the contents from unauthorized use or distribution I would appreciate the guidance.

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,871
    Location
    Quote Originally Posted by Imlost View Post
    Some time ago I opened a Word document from an online source to view the contents and as I remember I was only able to Save...not Save As and many of the editing button were grayed out and unavailable.
    That's easily defeated by disabling macros when you open the document.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  5. #5
    VBAX Newbie
    Joined
    Apr 2019
    Location
    Udon Thani
    Posts
    4
    Location
    I agree but I wonder if novice users would know that. My thoughts are that it would deter most users from sharing or accessing the document but of course some would slip by I guess. Thanks for the reply.

    If I wanted to move forward with this notion, is the VBA code very difficult and time consuming to create?

  6. #6
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,871
    Location
    Quote Originally Posted by Imlost View Post
    I agree but I wonder if novice users would know that.

    Many novices - and many others besides - won't allow untrusted macros to run as a matter of policy.
    Moreover, any 'novice' who's ever encountered something such as you're proposing will probably already know how to defeat it - and those who don't soon will.
    Quote Originally Posted by Imlost View Post
    If I wanted to move forward with this notion, is the VBA code very difficult and time consuming to create?
    No, the code is quite simple. For example, in Word:
    Private Sub Document_Open()
    If Now() < CDate("05,01,2019") Then Exit Sub
    MsgBox "Trial Period Expired.", vbCritical
    ThisDocument.Close False
    End Sub
    Cheers
    Paul Edstein
    [MS MVP - Word]

  7. #7
    VBAX Newbie
    Joined
    Apr 2019
    Location
    Udon Thani
    Posts
    4
    Location
    Paul,

    I appreciate your comments. It seems like an impossible ASK in reality...not to produce the code but to accomplish my goals.

    I'll have to rethink this idea.

    Thanks again,

    Marc

Posting Permissions

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