Macro para Imprimir hoja en impresora que no es la predeterminada.

Me podrían ayudar a generar una macro para imprimir una un archivo en dos paginas y mandarla a otra impresora que no es la predeterminada,

Tengo varias impresoras en red y la que uso predeterminada es una impresora matriz, el tema es que el reporte que quiero imprimir lo tengo que ajustar a dos paginas y enviarlo a imprimir a una impresora láser que tengo en red, he intentado grabar la macro para realizar esto pero se queda trabada en la plantilla de impresión y no se porque, no me tira la hoja a imprimir automáticamente.

1 Respuesta

Respuesta
5

Utiliza esta sentencia para que se abra un browse y puedas elegir la impresora que desees

Application.Dialogs(xlDialogPrinterSetup).Show

buen dia experto, anoche intente nuevamente grabar el código con la grabadora de macros y me tiro un código bien grande que no entendí lo que necesito es que el libro actual me lo mande a imprimir a otra impresora que no es la predeterminada y que lo haga en 1 hoja de ancho y 2 de largo, yo pensé que el código no iba a ser tan largo y al ver esto me desconcertó y no sabia ni que modificar...

sera posible hacer el código mas reducido y especifico.

este es el código de la grabadora

Range("F173").Select
ActiveWindow.SmallScroll Down:=-117
Range("A1:H109").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Application.ActivePrinter = "Lexmark T654 en Ne00:"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.748031496062992)
.RightMargin = Application.InchesToPoints(0.748031496062992)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 2
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
ExecuteExcel4Macro _
"PRINT(1,,,1,,TRUE,,,,,,1,""Lexmark T654 en Ne00:"",,TRUE,,FALSE)"
Range("C13").Select
Application.Dialogs(xlDialogSendMail).Show
Range("B5").Select

Utiliza el siguiente ejemplo y primero se abrirá el browse de impresora y después la vista previa para que configures el documento

Sub imprimir()
Application.Dialogs(xlDialogPrinterSetup).Show
Application.Dialogs(xlDialogPrintPreview).Show
End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas