macro to force double sided print

carlos.mesa

New Member
Joined
Feb 27, 2011
Messages
1
I have an excel spreadsheet (2007) form and I want a macro that will automatically print double sided to a network printer. Bascially, it's some macro to force the printer without the user adjusting the printer settings.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try

Code:
Sub printform()
Dim WS As Worksheet
Set WS = ActiveSheet
Dim sCurrentPrinter As String
sCurrentPrinter = ActivePrinter
For i = 0 To 9
Err.Clear
On Error Resume Next
Application.ActivePrinter = "LGLDOUBLE on Ne0" & i & ":"
If Err.Number = 0 Then GoTo printnow
On Error GoTo 0
Next
On Error GoTo 0
Exit Sub
printnow:
    Dim iCopies As String
    
    iCopies = Application.InputBox("How many copies do you want to print?", Type:=2)
    
    If iCopies <> vbNullString Then
    
        WS.PrintOut Copies:=iCopies
    Else
        Exit Sub
    End If
ActivePrinter = sCurrentPrinter
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top