#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Excel Security

Through data protection, we can lock sheet and workbook.

Is there a way to prevent a user or set a password for printing excel???
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Excel Security

ps.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Excel Security

Wow, another thing to learn.

I wish in the future excel feature can be added with print protection.

Thanks Dave.



"Dave Peterson" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel security Romolo Excel Discussion (Misc queries) 3 December 18th 07 08:18 PM
Security Excel BFSWE Excel Worksheet Functions 1 October 25th 07 05:14 PM
Excel & Security mich[_2_] Excel Discussion (Misc queries) 7 March 9th 07 03:14 PM
Excel Security Zygan Excel Discussion (Misc queries) 8 June 12th 06 01:22 AM
Excel Security?? Chris Watson Excel Discussion (Misc queries) 1 March 3rd 06 12:14 PM


All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"