×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Preventing file printing, saving changes to limit demo functionality

Preventing file printing, saving changes to limit demo functionality

Preventing file printing, saving changes to limit demo functionality

(OP)
I would like to allow others to view my excel file but I want to prevent them from (1) printing the file and (2) saving any changes they might have made. I would like to utilize this in a demo version of Excel application. The goal is to have the users obtain full version if they find it useful and would like to continue using it. Are there any are other simple, effective and "tamper-proof" ways to limit Excel file functionality that could be utilized to create demo version of spreadsheet application? Thanks for any ideas.

--
www.bridgeart.net

RE: Preventing file printing, saving changes to limit demo functionality

The only thing that comes to mind right off, with out using Microsoft's Rights Protection is to simply use the work sheet protection  built into Excel. Lock all of the cells in the work sheet except for those that you want the user to be able to edit. On your page set-up option on the file menu, set the print range to just cell A1. When you save the work book with the protection in place, you can specify that the user can only select the unlocked cells. As such, I don't think that they would be capable of changing the print range even, except to those cells which you specified as being selectable, your unlocked cells. And since they can not select the locked cells, they won't be capable of copying and pasting to a new workbook either.

RE: Preventing file printing, saving changes to limit demo functionality

Locking the print area doesn't work that way in my version (XL97). You can always clear it. However, you can add a workbook event procedure (yes, in the VB editor), Workbook_BeforePrint. It should look like this:

CODE

Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Cancel = True
End Sub
Then, protect the VB project.
However, if the user disables macros when opening the file, this macro will be disabled as well sad

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Preventing file printing, saving changes to limit demo functionality

(OP)
Markn82, I experimented with what you suggested and found that it is not completely tamper-proof, because the user can change the print range to the entire sheet from "File -> Print Area -> Clear Print Area" (accessible even when both the sheet and workbook are protected). You also mentioned Microsoft's Rights Protection - what is that and where can I find more information about it? Thanks.

--
www.bridgeart.net

RE: Preventing file printing, saving changes to limit demo functionality

well, there sort of is a technique, but its effectiveness and usefulness is questionable.  it has been many years since i did this myself, and i was not completely successful in meeting the same objectives you've stated.

from what i remember, simply remove all commands/menu items/toolbars from the workbook menu and save the workbook.  might even want to protect the workbook after making the changes.  highly recommend you experiment on a dummy workbook before embarking on actual workbook.  how to remove sub-menus (when right clicking) needs to be disabled as well.

usually, the objectives you've stated are used by developers or knowledgeable users of excel.  there are websites available that may provide you the details or examples of what you desire.

if further direction or references is needed, feel free to ask.

meanwhile, good luck!
-pmover

RE: Preventing file printing, saving changes to limit demo functionality

(OP)
Thank you all for your suggestions! Here is what I eventually came up with:

CODE

Private Sub Workbook_BeforePrint(Cancel As Boolean)
    MsgBox "WARNING - printing disabled in demo version!"
    Cancel = True
End Sub


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    MsgBox "WARNING - saving changes disabled in demo version!"
    Cancel = True
End Sub


Private Sub Workbook_Open()
    ActiveWorkbook.Unprotect "whatever_password"
    Sheets("Main").Activate
    Sheets("Main").Visible = True
    Sheets("EnableMacros").Visible = False
    ActiveWorkbook.Protect "whatever_password"
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ActiveWorkbook.Unprotect "whatever_password"
    Sheets("EnableMacros").Activate
    Sheets("EnableMacros").Visible = True
    Sheets("Main").Visible = False
    ActiveWorkbook.Protect "whatever_password"
End Sub


If the user disables macros when opening the file, all sheets will be hidden, so the spreadsheet will not be very useful. Here is a sample file:

http://www.bridgeart.net/spreadsheets/download/Load_Combinations_Demo.xls.

Thanks again!

--
www.bridgeart.net

RE: Preventing file printing, saving changes to limit demo functionality

It's worth remembering that there are heaps of free and cheap Excel unlockers available on the internet. Internal XL protection is not a commercial grade protection and it's generally viewed as being suitable for discouraging casual inspection. A compiled VB app may be a more satisfactory solution for commercial use.

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

Steam Engine enthusiasts: www.essexsteam.co.uk

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources