Jump to content
Fórum Script Brasil
  • 0

Construir link da Consulta WEB Excel


trcalgaro

Question

Ola pessoal

Preciso construir um code que "pegue" partes do link de pesquisa em algumas celulas da planilha

Sub Consulta()

Sheets("Plan1").Select
Cells.Select
Selection.Delete Shift:=xlUp

With ActiveSheet.QueryTables.Add(Connection:="URL;http://celepar7.pr.gov.br/gta/febreaftosa/relatorio_MunFronteira.asp?cmbCampanhaVFA=25&cmbEspecieVFA=0&rdRelatorio=8&cmbMunFront=4118451", Destination:=Range("A1"))
        .Name = "Consulta Geral"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "4"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub

Em teoria seria a construção do link seria a seguinte:

With ActiveSheet.QueryTables.Add(Connection:="URL;http://celepar7.pr.gov.br/gta/febreaftosa/relatorio_MunFronteira.asp?cmbCampanhaVFA="& Sheets("BD").Range("A2") & "&cmbEspecieVFA=0&rdRelatorio=8&cmbMunFront="& Sheets("BD").Range("A3"), Destination:=Range("A1"))

Mas é claro que o Code esta errado

alguém sabe como soluciono o problema?

Desde já Agradeço

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...