Ir ao conteúdo
  • Cadastre-se

Paulo_Oliveira

Membro Júnior
  • Posts

    9
  • Cadastrado em

  • Última visita

Reputação

0
  1. Prezados, mais uma vez solicito a ajuda dos senhores para o meu problema, pois estou chegando em uma semana critica onde preciso agilizar diversos procedimentos com este codigo e o mesmo esta inviabilizado pelo fato de nao conseguir mais imprimir e isso esta gerando um imenso HH. Se alguem puder ajudar, ficarei grato.
  2. Isso.... Acrobat Reader adicionado 0 minutos depois @nefertiti Isso.... Acrobat Reader
  3. Boa tarde! Senhores, esse codigo abaixo executa uma macro no SAP e chegando em determinada tela ele manda imprimir em pdf, ai segue em frente, porém quando ele abre a tela de salvar do PDF ele nao executa mais, pois o pdf teve uma atualização e o botao que era salvar virou save e ele nao aceita e nao prossegue as operações. fico agradecido. Private Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As LongPtr, ByVal lpString As String, ByVal cch As LongPtr) As LongPtr Private Declare PtrSafe Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As LongPtr) As LongPtr Private Declare PtrSafe Function GetWindow Lib "user32" (ByVal hWnd As LongPtr, ByVal wCmd As LongPtr) As LongPtr Private Declare PtrSafe Function IsWindowVisible Lib "user32" (ByVal hWnd As LongPtr) As Boolean Private Declare PtrSafe Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hWnd As LongPtr, ByVal msg As LongPtr, ByVal wParam As LongPtr, ByVal lParam As LongPtr, ByVal fuFlags As LongPtr, ByVal uTimeout As LongPtr, lpdwResult As LongPtr) As LongPtr Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As LongPtr, ByVal wParam As LongPtr, lParam As String) As LongPtr Private Declare PtrSafe Function PostMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As LongPtr, ByVal wParam As LongPtr, lParam As String) As LongPtr Private Declare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As LongPtr, ByVal hWnd2 As LongPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongPtr Private Const WM_CHAR = &H102 Private Const BM_CLICK As Long = &HF5& Private Const GW_HWNDNEXT = 2 Private Const WM_SETTEXT As Long = &HC Private Const VK_RETURN As Long = &HD Private Const WM_KEYDOWN As Integer = &H100 Private Const SMTO_ABORTIFHUNG As Long = &H2 Sub Imprimir_RM() Dim hWnd As String Dim hwndpdf As String Dim hwndsave As String Dim button As String Dim sendmessageError As String Dim nomeArquivo As String Dim a As Integer Dim pStr As String Dim pastaArquivo As String pastaArquivo = Cells(2, 4) If Right(pastaArquivo, 1) <> "\" Then pastaArquivo = pastaArquivo & "\" End If On Error Resume Next If Not IsObject(Julio) Then Set SapGuiAuto = GetObject("SAPGUI") Set Julio = SapGuiAuto.GetScriptingEngine End If If Not IsObject(Connection) Then Set Connection = Julio.Children(0) End If If Not IsObject(session) Then Set session = Connection.Children(0) End If If IsObject(WScript) Then WScript.ConnectObject session, "on" WScript.ConnectObject Julio, "on" End If On Error Resume Next session.findById("wnd[1]/usr/btnSPOP-OPTION2").press Application.DisplayAlerts = False x = 7 Do While Cells(x, 12).Value <> "" Tipo = UCase(Cells(x, 11).Value) If Tipo = "X" Then nomeArquivo = Cells(x, 14) Sheets("RM").Activate session.findById("wnd[0]/tbar[0]/okcd").Text = "ysmedicao" session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/usr/ctxtEKPO-WERKS").Text = "0200" session.findById("wnd[0]/usr/ctxtEKPO-KONNR").Text = Range("B2").Value session.findById("wnd[0]/usr/ctxtESSR-LZVON").Text = "" session.findById("wnd[0]/usr/ctxtESSR-LZBIS").Text = "" session.findById("wnd[0]/usr/ctxtYSMEDICAO_FRS-MEDICAO").Text = Cells(x, 12).Value session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/usr/cmbWC_PARCEIRO").Key = Range("B3").Value session.findById("wnd[0]/usr/cmbWC_PARCEIRO").SetFocus session.findById("wnd[0]/tbar[1]/btn[16]").press session.findById("wnd[0]/usr/tblSAPMYS_MEDICOES_REAJUSTAMENTOTABCTL_FRS").verticalScrollbar.Position = 0 'impressão session.findById("wnd[0]/tbar[1]/btn[5]").press session.findById("wnd[1]/tbar[0]/btn[86]").press Application.OnKey "{ENTER}", "Continue" session.findById("wnd[0]/tbar[0]/btn[15]").press 'enviar comandos janelas de impressão a = 1 hWnd = "" Do While hWnd = "" Or hWnd = "0" hWnd = FindWindow(vbNullString, "Imprimir") a = a + 1 Application.Wait (Now + TimeValue("0:00:01")) If a > 10000 Then MsgBox "erro" Exit Sub End If Loop button = FindWindowEx(hWnd, 0, "Button", "OK") sendmessageError = SendMessage(button, BM_CLICK, 0, 0) a = 1 hwndpdf = "" Do While hwndpdf = "" Or hwndpdf = "0" hwndpdf = FindWindow(vbNullString, "PDFCreator 1.7.0") a = a + 1 Application.Wait (Now + TimeValue("0:00:01")) If a > 10000 Then MsgBox "erro" Exit Sub End If Loop button = FindWindowEx(hwndpdf, 0, "ThunderRT6CommandButton", "&Salvar") Call SendMessageTimeout(button, BM_CLICK, 0, 0, 2, 10, 0) a = 1 hwndsave = "" Do While hwndsave = "" Or hwndsave = "0" hwndsave = FindWindow(vbNullString, "Salvar como") a = a + 1 Application.Wait (Now + TimeValue("0:00:01")) If a > 100 Then MsgBox "erro" Exit Sub End If Loop button = "" editButton = "" hwndsave = FindWindow(vbNullString, "Salvar como") arquivo = pastaArquivo & nomeArquivo Do While editButton = "" button = FindWindowEx(hwndsave, 0, "DUIViewWndClassName", "") button = FindWindowEx(button, 0, "DirectUIHWND", "") button = FindWindowEx(button, 0, "FloatNotifySink", "") button = FindWindowEx(button, 0, "ComboBox", "") editButton = FindWindowEx(button, 0, "Edit", "") Application.Wait (Now + TimeValue("0:00:01")) Loop sendmessageError = SendMessage(editButton, WM_SETTEXT, 0, ByVal arquivo) Application.Wait (Now + TimeValue("0:00:01")) button = FindWindowEx(hwndsave, 0, "Button", "Sa&lvar") sendmessageError = SendMessage(button, BM_CLICK, 0, 0) Application.Wait (Now + TimeValue("0:00:01")) sendmessageError = SendMessage(editButton, WM_SETTEXT, 0, ByVal arquivo) sendmessageError = SendMessage(button, BM_CLICK, 0, 0) End If x = x + 1 Loop session.findById("wnd[0]/tbar[0]/btn[15]").press End Sub
  4. Bom dia senhores(a), Preciso criar um formulário que calcule valor de frete e tenho isso em excel, porém não sei fazer em vba, mas entrei, e criei o designe do formulário. Alguém consegue me ajudar agora transferindo os cálculos para dentro do vba? Se alguém conseguir só falar que eu disponibilizo os arquivos..
  5. placa-mãe - gb -h110m-s2 i5 7400 1151 video- radeon 460 4gb memoria ddr4 2x8 fonte evea 500w bronze ssd 240gb e hd 1tr liguei em uma regua @edgar_
  6. Olá, boa noite...comprei as peças e tentei ligar o pc, pois meu note deu problema é preciso desesperadamente trabalhar e acabei comprando outra máquina para adiantar o serviço enquanto o note não volta, porém não tenho experiencia, então gostaria de pedir a ajuda dos senhores na ligação dos itens...comprei uma placa gb-h120m-s2... vou anexar algumas fotos para ver se conseguem me ajudar...pessoal, é. Em urgente, pois sou fotógrafo é preciso entregar alguns trabalhos que o prazo já se findaram...agradeço desde já... placa_mae.zip adicionado 29 minutos depois Conectei corretamente o cabo de alimentacao da placa e ela ligou, processador rodou ligou e em seguida desligou.
  7. Boa tarde! Sou novo aqui e gostaria da ajuda dos senhores. Eu consigo colocar nesta placa (GA-H110M-S2 (rev. 1.0) ) uma HD normal e um SSD? Muito Obrigado.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

Ebook grátis: Aprenda a ler resistores e capacitores!

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!