It works fine in Explorer, but not at all in Edge or Chrome.
It works fine in Explorer, because explorer authenticates the user before doing the QueryTables.Add. There is nothing in the code to prompt it to do it, but the windows security window pops up fine in explorer and asks the user to login but does not in Edge.
Since Excel doesn't authenticate the user, an error 1004 occurs because it does not have access to the file. How do I make Edge Authenticate the user?
Expand|Select|Wrap|Line Numbers
- ' Pull Data from the Web report data file
- With ActiveSheet.QueryTables.Add(Connection:= _
- strWebSite & strVariables, _
- Destination:=Range("A1"))
- .Name = "ReportData"
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .BackgroundQuery = False
- .RefreshStyle = xlOverwriteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlAllTables
- .WebFormatting = xlWebFormattingNone
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False ' <===== Here is the error 1004
- End With
URL;http://gemteam.Reports/ReportData.as...12&v0=10063832
I believe the issue might be something to do with referencing the ActiveSheet.
It works totally fine in explorer, but Edge seems to be blocking it somehow.
Any help would be greatly appreciated