Hi,
I have a regular office printer and receipt printer set up to my computer and am using the following code to switch to the receipt printer only when I need it.
Sub PrintSheet()
Dim STDprinter As String
STDprinter = Application.ActivePrinter
Application.ActivePrinter = "Receipt Printer on Ne00:"
ActiveSheet.PrintOut
Application.ActivePrinter = "\\ssaaes\BINARY_P1 on Ne06:"
End Sub
The problem is that once I run this macro, page breaks appear on every sheet in my workbook.
I've tried using the following code to remove the page breaks but the macro is too taxing on the program and often crashes mid-macro.
Sub Removeprintinglines()
Dim wbBook As Workbook
Dim wsSheet As Worksheet
Set wbBook = ThisWorkbook
For Each wsSheet In wbBook.Worksheets
If Not wsSheet.Name = "Blank" Then
wsSheet.Activate
With ActiveWindow
ActiveSheet.DisplayPageBreaks = False
End With
End If
Next wsSheet
ActiveSheet.ResetAllPageBreaks
End Sub
Does anyone have a more efficient workaround to removing the page breaks from all sheets or ensuring they never appear in the first place?
Thanks
Bookmarks