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
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