Hi guys,
I have a little issue I need to resolve, I have searched the forum but not found exactly what I need. Any help is appreciated.
Some of my work colleagues really struggle to even set up printer settings via some code I set up with the help of you guys. After rolling it out a couple of weeks ago quite a few are struggling with it so I need the code to do even more.
The code I use at the moment is on a command button and it works perfect if you choose the correct settings when it brings the "printer settings" up.
Private Sub CommandButton1_Click()
Dim bPrinted As Boolean
Dim LR As Long
'Print permit
Calculate
Unprotect Password:="password"
With Sheets("Electronic Permits")
LR = .Range("B" & Rows.Count).End(xlUp).Row
.Range("E" & LR).Value = Now
.Range("D" & LR).Value = Environ("username")
.Range("A" & LR).Copy
Application.ScreenUpdating = False
sheetname = .Range("C" & LR).Value
Sheets(sheetname).Activate
Sheets(sheetname).Visible = True
ActiveSheet.Range("D5").Select
ActiveSheet.Range("D5").PasteSpecial
Application.Dialogs(xlDialogPrinterSetup).Show
ActiveSheet.PageSetup.PrintArea = "$A$1:$AK$96"
ActiveWindow.SelectedSheets.PrintOut , copies:=1, collate:=True
Sheets(sheetname).Visible = xlSheetVeryHidden
Sheets("Electronic Permits").Activate
Application.ScreenUpdating = True
Protect Password:="password"
End With
End Sub
What I would like to do is instead of the "xlDialogPrinterSetup" showing I would like the code to do (this is the part some people struggle to do, some people thought I was talking totally alien to them)-
double sided on the short edge.
colour.
A3.
use tray 2.
and use a named printer (because some people using the spreadsheet will have a different default printer).
I know it might seem pretty basic to select the printer settings for the page set up but I need people to get this right. These are legal documents once they are printed off and signed.
As usual all the help is appreciated.
Craig.
I have a little issue I need to resolve, I have searched the forum but not found exactly what I need. Any help is appreciated.
Some of my work colleagues really struggle to even set up printer settings via some code I set up with the help of you guys. After rolling it out a couple of weeks ago quite a few are struggling with it so I need the code to do even more.
The code I use at the moment is on a command button and it works perfect if you choose the correct settings when it brings the "printer settings" up.
Private Sub CommandButton1_Click()
Dim bPrinted As Boolean
Dim LR As Long
'Print permit
Calculate
Unprotect Password:="password"
With Sheets("Electronic Permits")
LR = .Range("B" & Rows.Count).End(xlUp).Row
.Range("E" & LR).Value = Now
.Range("D" & LR).Value = Environ("username")
.Range("A" & LR).Copy
Application.ScreenUpdating = False
sheetname = .Range("C" & LR).Value
Sheets(sheetname).Activate
Sheets(sheetname).Visible = True
ActiveSheet.Range("D5").Select
ActiveSheet.Range("D5").PasteSpecial
Application.Dialogs(xlDialogPrinterSetup).Show
ActiveSheet.PageSetup.PrintArea = "$A$1:$AK$96"
ActiveWindow.SelectedSheets.PrintOut , copies:=1, collate:=True
Sheets(sheetname).Visible = xlSheetVeryHidden
Sheets("Electronic Permits").Activate
Application.ScreenUpdating = True
Protect Password:="password"
End With
End Sub
What I would like to do is instead of the "xlDialogPrinterSetup" showing I would like the code to do (this is the part some people struggle to do, some people thought I was talking totally alien to them)-
double sided on the short edge.
colour.
A3.
use tray 2.
and use a named printer (because some people using the spreadsheet will have a different default printer).
I know it might seem pretty basic to select the printer settings for the page set up but I need people to get this right. These are legal documents once they are printed off and signed.
As usual all the help is appreciated.
Craig.