Excel Macro Asking for credentials constantly

vbalearner11

New Member
Joined
Jan 19, 2018
Messages
18
Hello,

Below is my code which I am working on. It is running but keeps prompting for user windows credentials. Can anyone tell me how to stop that.? Do I need to any line of code to stop asking for credentials or pass credentials through code.

Sub testit()




Set shFirstQtr = ActiveWorkbook.ActiveSheet


Set qtQtrResults = shFirstQtr.QueryTables.Add(Connection:="URL;https://XXXXXXXXXXXXXXXXXXX.aspx", Destination:=shFirstQtr.Cells(1, 1))
Application.ScreenUpdating = False
With qtQtrResults
.Name = "YYYYYYYYYY"
.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 = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Application.ScreenUpdating = True
End Sub
 

Forum statistics

Threads
1,082,601
Messages
5,366,571
Members
400,902
Latest member
fathima

Some videos you may like

This Week's Hot Topics

Top