Case "Impresora"
Hoja1.ActiveSheet.Protection.Enabled = False
CDial1.CancelError = True
On Error Resume Next
CDial1.ShowPrinter
If Err.Number > 0 Then Exit Sub
strArchivo = "C:\Mis documentos\Prueba.xls"
Hoja1.ActiveSheet.Export strArchivo, ssExportActionNone
Set xl = CreateObject("Excel.application")
xl.Workbooks.Open strArchivo
With xl.Worksheets(1).PageSetup
'Tamaño de la hoja Encabezamiento y Pie de la página
'.LeftMargin = Application.InchesToPoints(0.1)
'.LeftMargin = Application.InchesToPoints(0.5)
'.RightMargin = Application.InchesToPoints(0.1)
'.TopMargin = Application.InchesToPoints(0.5)
'.BottomMargin = Application.InchesToPoints(0.9)
'.HeaderMargin = Application.InchesToPoints(0.1)
'.FooterMargin = Application.InchesToPoints(0.1)
.LeftMargin = Application.InchesToPoints(dblMarizq / 10)
.RightMargin = Application.InchesToPoints(dblMarder / 10)
.TopMargin = Application.InchesToPoints(dblMarsup / 10)
.BottomMargin = Application.InchesToPoints(dblMarinf / 10)
.HeaderMargin = Application.InchesToPoints(dblMarenc / 10)
.FooterMargin = Application.InchesToPoints(dblMarpie / 10)
.Zoom = intZoom
'Título del Encabezamiento de la página
.LeftHeader = "VIÑA LOS VASCOS S.A."
.CenterHeader = "&10&B" & "EXISTENCIA EN BODEGA" & Chr(13) & DBCombo1(3).Text & "&B"
.RightHeader = "&D &T" & Chr(13) & "Pág. &P/&N"
'Título del Pie de la página
.LeftFooter = "&8 SELECCION: Orden:Rubro, Rubro:Todos Grupo:Todos" & Chr(13) & _
" Unidad:Todas Lote: Todos" & Chr(13) & _
" Estado:Vigentes"
End With
'Busca Salto de Página
intSalto = 0
For J = 1 To intFila
If xl.ActiveSheet.Rows(J).PageBreak = xlPageBreakAutomatic Then
intSalto = J - 1
J = intFila
End If
Next J
intSalpag = Int((intFila + (Int(intFila / intSalto))) / intSalto)
If intSalpag > 0 Then
xl.Rows(1).Copy
For J = 1 To intSalpag
xl.Rows((intSalto * J) + 1).Insert
xl.Rows((intSalto * J) + 1).Paste
xl.Rows(1).Copy
Next
End If
If CDial1.FromPage = 0 And CDial1.ToPage = 0 Then
xl.Worksheets.PrintOut , , CDial1.Copies, , Printer.DeviceName
Else
xl.Worksheets.PrintOut CDial1.FromPage, CDial1.ToPage, CDial1.Copies, , Printer.DeviceName
End If
xl.Application.DisplayAlerts = False
'xl.Visible = True
xl.Workbooks.Close
Set xl = Nothing
Case "Excel"
strArchivo = "C:\Mis documentos\Prueba.xls"
Hoja1.ActiveSheet.Export strArchivo, ssExportActionOpenInExcel
Case "Imprimir Pantalla"
On Error Resume Next
Me.PrintForm
If Err.Number > 0 Then
strOK = MsgBox("Impresora no conectada", vbOKOnly, "Error")
End If
Case "Configuración"
Panel2.Visible = False
strF8 = "F8"
FormCL.Show
Lo compile y a mi me imprime super bien en todas las impresoras en donde trabajo... (laser, inyeccion a tinta, matriz de punto) osea conserva en todas el cambio realizado
En la parte configuracion tiene un INI donde modifica los cambios.
[Listados]
Estilo de letra=Arial
Tamano de letra=8
Ancho del listado=79
Margen superior=5
Margen inferior=9
Margen izquierdo=0
Margen derecho=0
Margen encabezado=1
Margen pie=5
Lineas de division=0
Encabezados de columna=0
Encabezados de fila=0
Ajusta al tamano de la letra=1
Cuadricula listado=0
Color encabezado=16776960
Color letras=0
Color subtotales=255
Color cuadriculado=0
Si yo modifico aqui la configuracion y compilo....
En el lugar donde tiene que funcionar solo copio el ejecutable......
Debo copiar algo mas???
el INI con el prueba.xls???
los dos o uno???
Porque da una error y se cae el programa
NO SE PORQUE
