为了账号安全,请及时绑定邮箱和手机立即绑定

我的Web查询宏的问题

我的Web查询宏的问题

HUH函数 2019-11-20 14:46:34
我编写了一个Web查询宏,用于根据单元格A1中的值从Yahoo Finance导入财务报表。在过去的几周中,它一直无缝运行,但是突然,它不再返回任何数据(但不会产生错误)。如果有人有任何见解,请多多关照。我在下面发布了代码-谢谢!Sub ThreeFinancialStatements()   On Error GoTo Explanation   Rows("2:1000").Select    Selection.ClearContents    Columns("B:AAT").Select    Range(Selection, Selection.End(xlToRight)).Select    Selection.ClearContents    Dim inTicker As String    inTicker = Range("A1")    ActiveSheet.Name = UCase(inTicker)    GetFinStats inTicker    Exit SubExplanation:   MsgBox "Please make sure you type a valid stock ticker symbol into cell A1 and are not trying to create a duplicate sheet." & _   vbLf & " " & _   vbLf & "Also, for companies with different classes of shares (e.g. Berkshire Hathaway), use a hyphen to designate the ticker symbol instead of a period (e.g. BRK-A)." & _   vbLf & " " & _   vbLf & "Please also note that not every company has three years of financial statements, so data may appear incomplete or missing for some companies.", _  , "Error"   Exit SubEnd SubSub GetFinStats(inTicker As String)'' GetBalSheet Macro''    With ActiveSheet.QueryTables.Add(Connection:= _        "URL;http://finance.yahoo.com/q/bs?s=" & inTicker & "+Balance+Sheet&annual", Destination:= _        Range("$D$1"))        .Name = "bs?s=PEP+Balance+Sheet&annual"        .FieldNames = True        .RowNumbers = False        .FillAdjacentFormulas = False        .PreserveFormatting = True        .RefreshOnFileOpen = False        .BackgroundQuery = True        .RefreshStyle = xlOverwriteCells        .SavePassword = False        .SaveData = True        .AdjustColumnWidth = True        .RefreshPeriod = 0        .WebSelectionType = xlSpecifiedTables        .WebFormatting = xlWebFormattingNone        .WebTables = "9"        .WebPreFormattedTextToColumns = True        .WebConsecutiveDelimitersAsOne = True        .WebSingleBlockTextImport = False        .WebDisableDateRecognition = False        .WebDisableRedirections = False        .Refresh BackgroundQuery:=False    End WithEnd Sub
查看完整描述

3 回答

?
白板的微信

TA贡献1883条经验 获得超3个赞

事实证明,雅虎结束了该应用程序,网络查询从该应用程序中提取了数据。感谢您的所有提示。


查看完整回答
反对 回复 2019-11-20
  • 3 回答
  • 0 关注
  • 515 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信