#1
|
|||
|
|||
Print hidden sheets
Hi all,
I am no whiz at excel and the code here, I used from another program. Can some please add the code to this string or tell me how to do it, Please. I have a workbook with 4 sheets - 2 are hidden. The following code I am using works with the hidden sheet. The problem is when I protect the sheets and workbook I get an error when I try to print the protected sheet or workbook. Can you suggest a workaround? Also I would like to view before print if that is possible... TIA GT ---------------------------------------------------------------- Sub PrintSpecificSheet() Dim wks As Worksheet Set wks = ActiveWorkbook.Sheets("Printout") If wks.Visible <> xlSheetVisible Then Application.ScreenUpdating = False wks.Visible = xlSheetVisible wks.PrintOut wks.Visible = xlSheetHidden Application.ScreenUpdating = True Else wks.PrintOut End If Set wks = Nothing End Sub |
#2
|
|||
|
|||
.
You need to first unprotect the sheet/s ... do the printing ... then protect the sheet/s again. |
#3
|
|||
|
|||
Yes thanks I understand that. However I am looking for the code to add to the one I am using (shown in the post) that WILL automatically unlock, preview, print, and lock again.
|
#4
|
|||
|
|||
.
ActiveSheet.Unprotect "pwd" '<--=- replace pwd with your actual password in quotes. ActiveSheet.Protect "pwd" |
#5
|
|||
|
|||
Thanks!! will give this a try.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
One veryhidden sheet, one hidden sheet and two visible sheets - how to saveas into .xlsm workbook | kiwimtnbkr | Excel Programming | 4 | 06-26-2019 11:30 AM |
How can set a command to print only specific sheets? | terrymac | Excel Programming | 2 | 12-01-2015 05:29 PM |
Print Area - setting Print Area on large sheets | nfotx | Excel | 2 | 12-27-2014 10:21 PM |
Print Multiple Sheets Double-Sided | flambe99 | Excel | 1 | 03-12-2010 01:15 PM |
Print with hidden cols? | markg2 | Excel | 2 | 01-06-2010 06:04 PM |