Link to home
Start Free TrialLog in
Avatar of ouestque
ouestqueFlag for United States of America

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.Add(Connection:= _
"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"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False

End With
Avatar of David L. Hansen
David L. Hansen
Flag of United States of America image

So the data still comes through even when the dialog fails to appear? Do I understand that correctly?
Avatar of ouestque

ASKER

The dialog never appears and therefore data does not come through.
ASKER CERTIFIED SOLUTION
Avatar of David L. Hansen
David L. Hansen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial