Thread: Excel Security
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Excel Security

Maybe...

You could turn off all printing and then provide a macro that would print under
the conditions you want.

But this would all depend on macros and macros can be disabled. So it would
only be effective if macros are enabled.

This goes behind the ThisWorkbook module:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
MsgBox "Please use the macro/button/whatever to print"
Cancel = True
End Sub


And this goes in a general module (and assigned to a button from the Forms
toolbar???):


Option Explicit
Sub DoMyPrint()

Dim pwd As String
pwd = InputBox(Prompt:="Enter a Password")

If pwd < "TopSecret PassWord Here" Then
MsgBox "no printing allowed"
Exit Sub
End If

Application.EnableEvents = False
Worksheets("sheet1").PrintOut preview:=True
Application.EnableEvents = True

End Sub


apache007 wrote:

Through data protection, we can lock sheet and workbook.

Is there a way to prevent a user or set a password for printing excel???


--

Dave Peterson