I have a code that is trying to set 11x17 paper by default ...
On Error GoTo PageSizeErr
ActiveSheet.PageSetup.PaperSize = xlPaperTabloid
'more code here
PageSizeErr:
On Error GoTo PageErr2
ActiveSheet.PageSetup.PaperSize = xlPaper11x17 'try another 11x17 driver definition
GoTo resumePrinting
PageErr2:
MsgBox ("There a problem setting Tabloid paper for the printer you have selected." & Chr(10) _
& "If you have an 11x17 printer selected, please contact EMBC, otherwise, try a different printer.")
Exit Sub
-------------- End of sample code -----------------
When it falls into the second line of ActivateSheet.PageSetup ... instead of going to the PageErr2 lable page, I get an error dialog box. (I chose a printer that does not support 11x17, which I am trying to verify.)
Multiple error handlers are needed because apparently different printer drivers handle the setting differently.
Why is the second sign of 'On Error goto' not recognized?
source
share