Log in

View Full Version : Office 2007. Word and Excel



Imlost
04-22-2019, 10:41 AM
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.

macropod
04-22-2019, 05:59 PM
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.

Imlost
04-22-2019, 07:02 PM
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.

macropod
04-22-2019, 07:13 PM
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.

Imlost
04-22-2019, 10:10 PM
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?

macropod
04-22-2019, 10:22 PM
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.

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

Imlost
04-23-2019, 09:27 AM
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

jolivanes
07-28-2020, 11:28 PM
The problem with designing something completely foolproof is to underestimate the ingenuity of complete fools.