is it possibilty to disable users from printing a specific worksheet in a
workbook or for the entire workbook?
is it possibilty to disable users from printing a specific worksheet in a
workbook or for the entire workbook?
The easiest is just to put this in your VBA Module:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub
I would put a msgbox in there though, Users gets all weird when things are not working the way it should
Google is your best friend!
Hi Walter
same as beararcade with a message box
Private Sub workbook_BeforePrint(Cancel As Boolean)
Cancel = True
MsgBox "Sorry, you cannot Print from this workbook", vbInformation
End Sub
Thx Bearacade, but can you put it in laments terms for me?
"Bearacade" wrote:
>
> The easiest is just to put this in your VBA Module:
>
> Private Sub Workbook_BeforePrint(Cancel As Boolean)
> Cancel = True
> End Sub
>
>
> --
> Bearacade
>
>
> ------------------------------------------------------------------------
> Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
> View this thread: http://www.excelforum.com/showthread...hreadid=563438
>
>
That code needs to go in the ThisWorkbook code module, not a
regular code module.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Bearacade"
<[email protected]> wrote in
message
news:[email protected]...
>
> The easiest is just to put this in your VBA Module:
>
> Private Sub Workbook_BeforePrint(Cancel As Boolean)
> Cancel = True
> End Sub
>
>
> --
> Bearacade
>
>
> ------------------------------------------------------------------------
> Bearacade's Profile:
> http://www.excelforum.com/member.php...o&userid=35016
> View this thread:
> http://www.excelforum.com/showthread...hreadid=563438
>
Hey Jetted,
Sounds good to me, but how do you do what both bearacade and you are saying
in simplke terms?
"jetted" wrote:
>
> Hi Walter
>
> same as beararcade with a message box
>
> Private Sub workbook_BeforePrint(Cancel As Boolean)
> Cancel = True
> MsgBox "Sorry, you cannot Print from this workbook", vbInformation
> End Sub
>
>
> --
> jetted
> ------------------------------------------------------------------------
> jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
> View this thread: http://www.excelforum.com/showthread...hreadid=563438
>
>
Ok.. so open your excel spreadsheet. Go to Tools > Macros > Visual Basic Editor (or you can just press Alt + F11)Originally Posted by Walter P
On the left side is the Project Explorer. You should see something with the name VBAProject (Name of your excel file)
Click it if it is not expanded already, and double click on ThisWorkbook. Put the code in the box that pops up.
HTH
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks