Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por Luciano021273
Posts
#12584
Bom dia,

Estou com problema na impressão do relatório
Quando gero relatório para impressão e estou com a plan aberta ele gera normalmente,
mas quando coloquei para quando abrir meu userform e unload na plan, não consigo abrir a pagina de impressão ela some e não aparece mais, tenho que reiniciar o computador para fazer novamente, mas ai quando estou com o userfor aberto sobre a plan, consgigo fazer o procedimento...

segue o código baixo:
Código: Selecionar todos
Private Sub btIMPRIMIR_Click()
Application.ScreenUpdating = False

Worksheets("Papel_Orçamento").Select
Range("b2").Select

'''lIMPA AS PLANILHA ONDE GERA O RELATÓRIO
Plan13.Range("E12:G12").Select
Selection.ClearContents
Plan13.Range("B17:J27").Select
Selection.ClearContents
Plan13.Range("J31:J36").Select
Selection.ClearContents

''''''''''''''''''''''''''''''''''''''''''''''''''''

'''PUXA OS VALORES DA PLANILHA PREÇO PARA O PLANILHA GERA RELATÓRIO PARA LISTVIEW
Dim WS As Worksheet
Set WS = Worksheets("Papel_Orçamento")
Range("B2").Select

If cbPesqNomeCliente.Value = "" Then
MsgBox " SELECIONE ALGUM NOME PARA PODER CADASTAR!", , ""
Exit Sub
End If
'iRow = ActiveCell.Row
'CDbl
On Error GoTo continue

WS.Cells(12, 5).Value = Me.cbCodCliente.Value
WS.Cells(12, 7).Value = Me.cbPesqNomeCliente.Value

WS.Cells(17, 2).Value = Me.txtCodI.Value
WS.Cells(17, 4).Value = Me.cmbAmbienteI.Value
WS.Cells(17, 10).Value = CDbl(Me.valorfinal1.Value)


WS.Cells(18, 2).Value = Me.txtCodII.Value
WS.Cells(18, 4).Value = Me.cmbAmbienteII.Value
WS.Cells(18, 10).Value = CDbl(Me.valorfinal2.Value)

WS.Cells(19, 2).Value = Me.txtCodIII.Value
WS.Cells(19, 4).Value = Me.cmbAmbienteIII.Value
WS.Cells(19, 10).Value = CDbl(Me.valorfinal3.Value)

WS.Cells(20, 2).Value = Me.txtCodIV.Value
WS.Cells(20, 4).Value = Me.cmbAmbienteIV.Value
WS.Cells(20, 10).Value = CDbl(Me.valorfinal4.Value)

WS.Cells(21, 2).Value = Me.txtCodV.Value
WS.Cells(21, 4).Value = Me.cmbAmbienteV.Value
WS.Cells(21, 10).Value = CDbl(Me.valorfinal5.Value)

WS.Cells(22, 2).Value = Me.txtCodVI.Value
WS.Cells(22, 4).Value = Me.cmbAmbienteVI.Value
WS.Cells(22, 10).Value = CDbl(Me.valorfinal6.Value)

WS.Cells(23, 2).Value = Me.txtCodVII.Value
WS.Cells(23, 4).Value = Me.cmbAmbienteVII.Value
WS.Cells(23, 10).Value = CDbl(Me.valorfinal7.Value)

WS.Cells(24, 2).Value = Me.txtCodVIII.Value
WS.Cells(24, 4).Value = Me.cmbAmbienteVIII.Value
WS.Cells(24, 10).Value = CDbl(Me.valorfinal8.Value)

WS.Cells(25, 2).Value = Me.txtCodIX.Value
WS.Cells(25, 4).Value = Me.cmbAmbienteIX.Value
WS.Cells(25, 10).Value = CDbl(Me.valorfinal9.Value)

WS.Cells(26, 2).Value = Me.txtCodX.Value
WS.Cells(26, 4).Value = cmbAmbienteX.Value
WS.Cells(26, 10).Value = CDbl(Me.valorfinal10.Value)

WS.Cells(27, 2).Value = Me.txtCodXI.Value
WS.Cells(27, 4).Value = Me.cmbAmbienteXI.Value
WS.Cells(27, 10).Value = CDbl(Me.valorfinal11.Value)

'WS.Cells(30, 10).Value = Me.txtValorFinanciar.Value
WS.Cells(32, 10).Value = Me.TextBox1.Value
WS.Cells(32, 11).Value = Me.TextBox2.Value
WS.Cells(32, 12).Value = Me.cbCondPgto.Value
WS.Cells(34, 10).Value = Me.txtValorEntrada.Value
WS.Cells(36, 10).Value = Me.txtValorParcela.Value

continue:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
MsgBox "DESEJA IMPRIMIR O ORÇAMENTO?", , ""
cbPesqNomeCliente.SetFocus




'''''###############################  Gera o relatorio para impressão

Dim IMPRI As Worksheet
Set IMPRI = Worksheets("Papel_Orçamento")
Range("B2").Select

If cbPesqNomeCliente.Value = "" Then
MsgBox " SELECIONE ALGUM NOME e GERE ORÇAMENTO PARA PODER IMPRIMIR!", , ""
Exit Sub
End If

Plan13.Select
    E_NEGOCIAÇÃO.Hide
    Application.Dialogs(xlDialogPrintPreview).Show
    E_NEGOCIAÇÃO.Show
    
   Application.ScreenUpdating = True
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord