VBA webquery works in Excel 2010 but does not work in 2019

sprivatester

New Member
Joined
Aug 15, 2021
Messages
1
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
following vba webquery works perfectly in excel 2010 but goes on forever waiting mode in excel 2019, debugging shows error on, .Refresh BackgroundQuery:=False

With Sheets("Sheet2").QueryTables.Add(Connection:= _
"URL;http://www.nseindia.com/products/dynaContent/equities/indices/total_returnindices.jsp?indexType=" + indexName + "&fromDate=" + startDate + "&toDate=" + endDate _
, Destination:=Sheets("Sheet2").Range("$a$1"))
.Name = _
"historicalindices.jsp?indexType=CNX%20100&fromDate=01-01-2014&toDate=01-10-2014"
.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 = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False

End With

Thanks for all the help I got for so many years from mrexcel without even registering! But, this problem I could not find in any other posts. So, registered and opened my first post :)
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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