ouestque
asked on
Excel VBA: Excel 2016: Query Tables No Longer Display Dialog
I found a snippet of VBA code written by Alex Paras online that pulls from password protected websites. When running this code, a Security Dialog prompting for a username/password appears automatically. Nonetheless, I noticed some machines at my company do not show the dialog box asking for the username/password and therefore the code no longer works.
All machines have Excel 2016 and the most recent patch. The code snippet is below. I'm sorry as I know this is not much to go on. Any ideas on what would cause a username/password dialog not to appear when running query tables?
With ActiveSheet.QueryTables.Ad d(Connecti on:= _
"URL;http://www.urbics.com/Urbics.php?hs=a97cd706q9948q11e1qbbacq00259002436c&pgreq=AVTotals&aid=4517", Destination:=Range("$B$4") )
.Name = "q?s=goog_2"
.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 = "1,2"
.WebPreFormattedTextToColu mns = True
.WebConsecutiveDelimitersA sOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
All machines have Excel 2016 and the most recent patch. The code snippet is below. I'm sorry as I know this is not much to go on. Any ideas on what would cause a username/password dialog not to appear when running query tables?
With ActiveSheet.QueryTables.Ad
"URL;http://www.urbics.com/Urbics.php?hs=a97cd706q9948q11e1qbbacq00259002436c&pgreq=AVTotals&aid=4517", Destination:=Range("$B$4")
.Name = "q?s=goog_2"
.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 = "1,2"
.WebPreFormattedTextToColu
.WebConsecutiveDelimitersA
.WebSingleBlockTextImport = False
.WebDisableDateRecognition
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
So the data still comes through even when the dialog fails to appear? Do I understand that correctly?
ASKER
The dialog never appears and therefore data does not come through.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.