这个VBA给我一个后台刷新错误,我该如何摆脱这种调试 [英] this vba is giving me a background refresh error, how can i get rid of this debug
本文介绍了这个VBA给我一个后台刷新错误,我该如何摆脱这种调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此vba给我一个后台刷新错误,我该如何摆脱这种调试状态
this vba is giving me a background refresh error, how can i get rid of this debug
Sub Macro21()
'
' Macro21 Macro
'
'
Dim url As String
Dim namedt As String
url = Sheets("sheet18").Range("G2")
namedt = Sheets("sheet18").Range("I2")
Range("E2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.sec.gov" & "url", Destination:=Range("$A$10"))
.Name = "namedt"
.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 = "300,301,302"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
推荐答案
"URL;https://www.sec.gov" & "url", Destination:=Range("$A$10"))
.Name = "namedt"
丢失引号,因此:
"URL;https://www.sec.gov" & url, Destination:=Range("$A$10"))
.Name = namedt
在A10中我什么也没得到,但至少可以运行.
I get nothing in A10, but at least it runs.
这篇关于这个VBA给我一个后台刷新错误,我该如何摆脱这种调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文