Disabling the ability to Print

W

wildguts

I've created a spreadsheet that I want to show to others to test it
out and troubleshoot it, but I don't want these users to be able to
actually print the sheets. Is there a way to do this? Can I create
a macro that runs when the documents opens, then selects the Print
Area to print only the top line, and then protect the macro with the
rest of the worksheets? That's the only way I can think of to do
this. Any ideas?
 
J

JE McGimpsey

I've created a spreadsheet that I want to show to others to test it
out and troubleshoot it, but I don't want these users to be able to
actually print the sheets. Is there a way to do this? Can I create
a macro that runs when the documents opens, then selects the Print
Area to print only the top line, and then protect the macro with the
rest of the worksheets? That's the only way I can think of to do
this. Any ideas?

You could certainly do that. Then the user could simply open the
workbook with the Shift key held down and print normally.

Failing that, the user could type CMD-SHIFT-4 to take a picture of the
window, and print the picture.

An easier macro would be to intercept the Workbook_BeforePrint() event
(put this in the ThisWorkbook module):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

However, if you actually want to *prevent* printing from XL, you should
know that there's no way to stop even mildly adept users (e.g., anyone
able to find these newsgroups) from bypassing any of XL's internal
protections, including macros.

If a user can open a file, you must assume that he or she has complete
access to it.
 
W

wildguts

You could certainly do that. Then the user could simply open the
workbook with the Shift key held down and print normally.

Failing that, the user could type CMD-SHIFT-4 to take a picture of
the
window, and print the picture.

An easier macro would be to intercept the Workbook_BeforePrint()
event
(put this in the ThisWorkbook module):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

However, if you actually want to *prevent* printing from XL, you
should
know that there's no way to stop even mildly adept users (e.g.,
anyone
able to find these newsgroups) from bypassing any of XL's internal
protections, including macros.

If a user can open a file, you must assume that he or she has
complete
access to it.
===============================
Thank you for the reply.

I understand that there is no solid way to disable the printing. The
users in my sharing group all share the understanding that our
spreadsheet is not to be printed, but we still wanted to throw in a
"speed bump" to remind everyone not to print... sorta like locking the
car and taking the keys, but we know there's always the slim-jim
option for anyone who really, really wants to get in.

Also, there are a number of folks in my group who will have Windows
versions of XL, so I'm presuming any macros written will be
compatible. 2004 for Mac has that compatibility check feature, and
I've never seen it flag a doc for macro incompatibilities (usually
it's date formats).

Again, thank you for the feedback. Can I bug you for a few extra
details on the solution you offered? I'm a self-taught Excel dabbler,
and although I learn and adapt very quickly, I need a little help when
entering new territory... but not a lot. The macros/visual basic are
not unfamiliar, but they aren't things I've actually grazed into with
scripting yet, either.

Bill Niehausen
 
J

JE McGimpsey

Again, thank you for the feedback. Can I bug you for a few extra
details on the solution you offered? I'm a self-taught Excel dabbler,
and although I learn and adapt very quickly, I need a little help when
entering new territory... but not a lot. The macros/visual basic are
not unfamiliar, but they aren't things I've actually grazed into with
scripting yet, either.

You can post any questions here...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top