Jump to content
Fórum Script Brasil
  • 0

Pegar link de popup


Mateus Balan

Question

Ola sou novo programando em VBA e estou com um problema.

A ideia do codigo é importar o relatorio que esta contido no popup que este link abre.

http://www.ccee.org.br/cceeinterdsm/v/inde...p;x=11&y=10

- a ideia inicial era atravez do VBA selecionar os box mas como o string é padrão eu monto ele usando a data que quero.

RESUMO preciso pegar o link do popup que abre atravez deste outro primeiro link

estou usando este codigo:

Sub getRelatorio()

On Error Resume Next

Dim ie As Object

Dim ENDERECO_1 As String

Dim ENDERECO_2 As String

'link previsivel

ENDERECO_1 = "http://www.ccee.org.br/cceeinterdsm/v/index.jsp?qryRELATORIO-ANO=2011&qryRELATORIO-MES=02&cd_categoria=843ec04407867210VgnVCM1000005e01010a____&contentType=RELATORIO&vgnextoid=dc202d20f080b010VgnVCM1000005e01010aRCRD&x=11&y=10"

Set ie = CreateObject("InternetExplorer.Application")

ie.navigate (endereco)

ie.Visible

'importacao da tabela atravez do link 2 que não sei obter

ActiveWorkbook.Worksheets.Add

With ActiveSheet.QueryTables.Add(Connection:= _

ENDERECO_2 _

, Destination:=Range("$A$1"))

.Name = _

ENDERECO_2

.FieldNames = True

.RowNumbers = False

.FillAdjacentFormulas = False

.PreserveFormatting = True

.RefreshOnFileOpen = False

.BackgroundQuery = True

.RefreshStyle = xlInsertDeleteCells

.SavePassword = False

.SaveData = True

.AdjustColumnWidth = True

.RefreshPeriod = 0

.WebSelectionType = xlEntirePage

.WebFormatting = xlWebFormattingNone

.WebPreFormattedTextToColumns = True

.WebConsecutiveDelimitersAsOne = True

.WebSingleBlockTextImport = False

.WebDisableDateRecognition = False

.WebDisableRedirections = False

.Refresh BackgroundQuery:=False

End With

End Sub

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...