Erro VB no Windows 10

Anônima
2019-11-27T18:06:11+00:00

Boa Tarde,

podem me ajudar estou tendo problema para executar um código, só para entender sou iniciante no VB, esse codigo foi montado para coletar informações de uma pagina html, funciona perfeito no win 7, porem nao consigo executar no win 10, e a empresa esta migrando todas as maquina para o win 10, vo deixa a imagem do codigo e o erro.

Microsoft 365 e Office | Excel | Para uso doméstico | Windows

Pergunta bloqueada. Essa pergunta foi migrada da Comunidade de Suporte da Microsoft. É possível votar se é útil, mas não é possível adicionar comentários ou respostas ou seguir a pergunta.

0 comentários Sem comentários

1 resposta

Classificar por: Mais útil
  1. Anônima
    2019-11-27T18:09:11+00:00

    segue cod.

    'Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Sub xml2()

        Columns("B:B").Select

        Selection.ClearContents

        Range("B1").Select

        ActiveCell.FormulaR1C1 = "Cod: Agen. por"

    ''    Range("C1").Select

    ''    ActiveCell.FormulaR1C1 = "Comfir."

    '    Range("D1").Select

    '    ActiveCell.FormulaR1C1 = "??"

    '    Range("E1").Select

    '    ActiveCell.FormulaR1C1 = "Comfir."

        Range("A1").Select

            Range("L6:M8").Select

        ActiveCell.FormulaR1C1 = "Buscando ..."

        Range("L6:M8").Select

        With Selection.Interior

            .Pattern = xlSolid

            .PatternColorIndex = xlAutomatic

            .ThemeColor = xlThemeColorAccent2

            .TintAndShade = 0.399975585192419

            .PatternTintAndShade = 0

        End With

        Selection.Font.Bold = True

        With Selection.Interior

            .Pattern = xlSolid

            .PatternColorIndex = xlAutomatic

            .ThemeColor = xlThemeColorAccent1

            .TintAndShade = 0.599993896298105

            .PatternTintAndShade = 0

        End With

    Dim IeI As InternetExplorer

        Dim elemCollection As Object

        Dim obj As Object

       Dim LNIL, linha, lh, i As Long

       Dim gpon, dvr, dvr2, sip, tdm, vdsl, adsl, Upgrade, levocidade, pontos As Variant

       Dim alt, tags, cabeamento, modemm, trocamodem, up, cinco, dez, vinte, trinta, cinquenta, cem, Desconectar, Adicionar, Ativo As String

       Dim enc As String

            Set IeI = CreateObject("InternetExplorer.Application")

      With IeI

       .navigate "http://appwfm.gvt.net.br/wfm-search/rs/v2/workorder/8-47438241256-1"

              Do While .Busy Or .readyState <> 4

                   DoEvents

              Loop

    For w = 2 To WorksheetFunction.CountA(ThisWorkbook.Worksheets("Ordens").Columns(1))

     Worksheets("Ordens").Cells(w, 5).Value = "*"

           ordem = Split(Worksheets("Ordens").Cells(w, 1).Value, ":", -1)

          .navigate "http://appwfm.gvt.net.br/wfm-search/rs/v2/workorder/" & ordem(0)

            .Visible = True

                     Do While .Busy Or .readyState <> 4

                       DoEvents

                     Loop

    '

    '

                  ' Sleep 500

          '  MyWaitMacro (1)

            ' MsgBox .document.activeElement.innerText

              ' MyWaitMacro (1)

            '  tags = Replace(Replace(Replace(.Document.activeElement.innerText, ">", ""), "</", ""), "<", "")

            '  tags = Replace(tags, "-", "")

            tags = .Document.activeElement.innerText

            tags = Replace(tags, vbCrLf, "")

            tags = Replace(tags, "Power ", "")

            '*********************************************  obs de injeçao

            dia = Left(Worksheets("Ordens").Cells(w, 18).Value, 6) & "2019"

                    voz = "*<scheduledBy>GPS_1</scheduledBy>*"

         Compara = tags Like voz

         If Compara Then

         Worksheets("Ordens").Cells(w, 2).Value = voz

         End If

         mat = Null

    Next w

    End With

        Range("L6:M8").Select

        ActiveCell.FormulaR1C1 = "FIM"

        Range("L6:M8").Select

        With Selection.Interior

            .Pattern = xlSolid

            .PatternColorIndex = xlAutomatic

            .Color = 192

            .TintAndShade = 0

            .PatternTintAndShade = 0

        End With

        With Selection.Interior

            .Pattern = xlSolid

            .PatternColorIndex = xlAutomatic

            .Color = 255

            .TintAndShade = 0

            .PatternTintAndShade = 0

        End With

        Range("F9").Select

    End Sub

    Esta resposta foi útil?

    0 comentários Sem comentários