Disable Print Screen Challenge

  • Thread starter Thread starter Fable
  • Start date Start date
F

Fable

Greeting,

I’m looking for a way to disable the Print Screen function to avoi
user from capturing the screen and pasting it to other application.
got the copy functions (menu, sub menu, right clicks etc) all disable
but the print screen is the only hurdle left.

I’m looking for a solution that not necessarily use an time interval t
clear the clip board.

Any thoughts . . .


Fabl
 
Hi

do you mean the print screen from the keyboard using alt & printscreen /
printscreen or if they use a screen capture program such as snaggit or
hypersnap or one of those?

Cheers
JulieD
 
Hi,

If the information is so secret and confidential, then I think that excel is
not the right program.
The excel PW to open, modify or even open your VB project can be cracked so
easily.
Don't waste your efforts.

Regards,

Jean-Yves
 
Hi Julie, it would be a solution for ALT + PRTSC . . . snagit or othe
programs would be difficult to avoid capture (plus my users, are no
that techy) . THANKS!

Fable
 
Plus macros can be disabled, so any protection based on running a macro is
weak.

--
Regards,
Tom Ogilvy

Jean-Yves said:
Hi,

If the information is so secret and confidential, then I think that excel is
not the right program.
The excel PW to open, modify or even open your VB project can be cracked so
easily.
Don't waste your efforts.

Regards,

Jean-Yves
 
Hi Jean,

I realize that, and have cracked a few myself. Never the less my user
are not that savvy, and I’m not looking for an 100% bullet proo
platform. Just trying to minimize possible damage / intervention for
my users. Any thoughts?

Fable
 
Beware!

even if you have the copy functions (menu, sub menu, right clicks etc
all disable.

Looks like if you got 2 copy controls ".FindControl(Id:=19) on the sam
toolbar
is not possible to disable both of then, just one.

At least i get this problem
 
Hi Fable,

What do you want to avoid.
Analize the fact, what may or may not be displayed
What should exactly be avoided ( a screenshot, Print-out). If it may not be
copied, why showing it ?
Printing does or copying should not harm your data. You can hide your
source data if you want.

Regards

JY
 
Hi Tom,

I have an event handler if macros are disabled that won’t allow acces
and I’m well aware that holes can be shot through excel, if you kno
how to avoid a print screen capture (ALT+PRTSC) appreciate.

Fable


Tom said:
*Plus macros can be disabled, so any protection based on running
macro is
weak.
 
Thank 4 your prompt response Jean,

Screen Capture (ALT+PRTSC) / being copied to another application lik
word, powerpoint etc is what I want to avoid. I would not mind if the
print it out.


Jean-Yves said:
Hi Fable,

What do you want to avoid.
Analize the fact, what may or may not be displayed
What should exactly be avoided ( a screenshot, Print-out). If it ma
not be
copied, why showing it ?
Printing does or copying should not harm your data. You can hid
your
source data if you want.

Regards

J
 
Fable,

You mentioned that you already have code to do exactly what I have been
searching for. Would you be willing to share?

Thanks
Galindez
 
Hi Galindez,

Would you like the code for the Copy & Paste disable or the Even
Handler Macro that does not allow access to the workbook unless th
user enables macro?


Fable
*Fable,

You mentioned that you already have code to do exactly what I hav
been
searching for. Would you be willing to share?

Thanks
Galindez

Fable > said:
Hi Julie, it would be a solution for ALT + PRTSC . . . snagit o other
programs would be difficult to avoid capture (plus my users, ar not
that techy) . THANKS!

Fable

 
I would like both if possible. Currently I am using Copy protect one below,
but I ran into a problem in that If the user holds down the shift key when
double-clicking the file to open, the Worksheet_Open function is disabled.

But I definately do not have anything on the macro force when opening.

Private Sub Worksheet_Open()
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "+{DEL}", ""
Application.OnKey "+{INSERT}", ""
Application.CellDragAndDrop = False
End Sub

Public Sub Workbook_Close()

Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
Application.CellDragAndDrop = True
End Sub

THANKS,
Galindez

Fable > said:
Hi Galindez,

Would you like the code for the Copy & Paste disable or the Event
Handler Macro that does not allow access to the workbook unless the
user enables macro?


Fable
*Fable,

You mentioned that you already have code to do exactly what I have
been
searching for. Would you be willing to share?

Thanks
Galindez
 
Here the code for Copy & Paste
============================
Sub DisableCopyCutAndPaste()
Application.ScreenUpdating = False
'
EnableControl 21, False ' cut
EnableControl 19, False ' copy
EnableControl 22, False ' paste
EnableControl 755, False ' pastespecial
Application.OnKey "^c", "Dummy"
Application.OnKey "^v", "Dummy"
Application.OnKey "+{DEL}", "Dummy"
Application.OnKey "+{INSERT}", "Dummy"
Application.OnKey "+{PRTSC}", "Dummy"
Application.CellDragAndDrop = False
Application.OnDoubleClick = "Dummy"
CommandBars("ToolBar List").Enabled = False
Application.CutCopyMode = True
End Sub

Sub EnableCopyCutAndPaste()
Application.ScreenUpdating = False
'
EnableControl 21, True ' cut
EnableControl 19, True ' copy
EnableControl 22, True ' paste
EnableControl 755, True ' pastespecial
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
Application.OnKey "+{PRTSC}"
Application.CellDragAndDrop = True
Application.OnDoubleClick = ""
CommandBars("ToolBar List").Enabled = True
'FORCE A EMPTY CLIP BOARD
Range("A1").Select
Selection.Copy
Range("A2").Select
ActiveSheet.Paste
Range("A1").Select
Application.CutCopyMode = False
End Sub

Sub EnableControl(Id As Integer, Enabled As Boolean)
Dim CB As CommandBar
Dim C As CommandBarControl

On Error Resume Next
For Each CB In Application.CommandBars
Set C = CB.FindControl(Id:=Id, recursive:=True)
If Not C Is Nothing Then C.Enabled = Enabled
Next

End Sub

Sub Dummy()
'// NoGo
MsgBox "Sorry command not Available!"
End Sub

==================================
The solution too force people to use macro is pretty easy, in
nutshell the code below does the following, when you close you
workbook it will hide the sheets you have programmed, leaving only on
sheet visible call “ERROR” (in this case), so if the user opens th
workbook without enabling macros all they will get is the Error (wit
some type of message, like you must enable macro to access file), an
when the user does select Enable macros the code makes the sheets tha
where once hidden visible again.

'In your Workbook place this code

Private Sub Workbook_Open()
Call Unhide_Sheets
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call Hide_Sheets
End Sub

==================================

'Create a Module and place this code

Sub Hide_Sheets()
Application.ScreenUpdating = False
'
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Visible = False
'
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
'
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Visible = False

Sheets("ERROR").Select

Range("A1").Select
End Sub
Sub Unhide_Sheets()
Application.ScreenUpdating = False
'
Sheets("Sheet1").Visible = True
Sheets("Sheet2”).Visible = True
Sheets("Sheet3").Visible = True
Range("A1").Select
End Sub

=======================
Hope this helps!

Fabl
 
Use this is better:


Sub MenuControl_Enabled_True()
Dim Ctl As CommandBarControl
Dim Cbar As Integer
Dim MyArray
Dim X As Byte
Application.ScreenUpdating = False
MyArray = Array(4, 19, 21, 22, 109, 186, 247, 259, 755, 841, 847
848, 859, 1561, 1695, 2019, 2040, 2045, 2046, 2047, 2048, 2188, 2521
3708, 30017, 3738, 5958, 30026, 30029, 30095, 30255)
On Error Resume Next
For Cbar = 1 To Application.CommandBars.Count
For Each Ctl In CommandBars(Cbar).Controls
For X = LBound(MyArray) To UBound(MyArray)
If Ctl.ID = MyArray(X) Then Ctl.Enabled = True

Application.CommandBars(Cbar).FindControl(ID:=MyArray(X)
Recursive:=True).Enabled = True
Next X
Next Ctl
Next Cbar
With Application
.OnKey "^c"
.OnKey "^v"
.OnKey "^p"
.OnKey "+{DEL}"
.OnKey "+{INSERT}"
.CellDragAndDrop = True
.OnKey "%{F11}"
End With
On Error GoTo 0
End Sub

Otherwise you may find many problems.
such us: duplicates controls on the same toolbar, RightClick (PLY )
edit/move or copy sheet, vba manpulation..
 
Back
Top