Table is not downloading to excel

adipat

New Member
Joined
Jul 2, 2022
Messages
4
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
Hello,

this is my headache for last few days, I have been trying to get a table from a link from a cell and i cant get it. link works fine and also same code works for other links in the same workbook. if anyone can help plz. this will help me a lot

VBA Code:
Sub PPA1()
Dim www1 As String
Dim sht As Worksheet
Dim lastrow As Integer
Dim URL$(0 To 1)

Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

Set sht = ThisWorkbook.Sheets("PPA1")
lastrow = Sheets("PPA1").Cells(Rows.Count, 2).End(xlUp).Row

Worksheets("PPA1").Range("A:F").Clear
www1 = Sheets("Instructions").Range("f14")

With sht.QueryTables.Add(Connection:= _
"URL;" & www1 _
, Destination:=sht.Cells(1, 1))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False

End With
Application.CutCopyMode = False

With ThisWorkbook
For lngConn = .Connections.Count To 1 Step -1
.Connections(lngConn).Delete
Next lngConn
End With
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,098
Messages
6,170,106
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top